J
J
JohnZoidberg2015-03-29 17:28:45
Objective-C
JohnZoidberg, 2015-03-29 17:28:45

How to keep the ViewController entity when navigating back through the Navigation Controller?

The application has two view controllers: a list of folders and a player with a playlist. We chose a folder - the player found the files and went to play them. From the player, you can go back to the folders with the Back button. But how to go back to the player, saving all the data?
If you simply add a segue from the list of folders to the player for this, a new player entity will be opened. It is not clear whether the entity of the player is deleted when moving back, or a new one is created when moving forward.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
ManWithBear, 2015-03-29
@JohnZoidberg

Simultaneously. When moving backward, the current one is deleted; when moving forward, a new one is created.
Options:
1) Create a container (for example, a tabbar controller) and make folders with the player two tabs
2) Add a strong pointer to the player to the controller with folders, and if necessary, go to it, push it, and not create a new one.

R
Roman, 2015-04-04
@DaskOFF

If there should be only one player, you can create a singleton and control it from anywhere

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question