Here is my problem:
I have a basic application with a UIViewController
embedded in a NavigationController
. It is also the RootViewController
of the application. From there I have a push segue to a normal UIViewController
and a second push segue to a UITableViewController
with its own UIViewController
for the detailed view.
In the root view there is an instance of the class whose purpose is to send message with a define protocol. In the table view the user will select the type of message he wants to send and in the detail view the content of that particular type of message.
Now the user has specified everything and I want him to push a "send" button. That button must do two things: pop back to the root view and send the user defined message by the protocol class instance. I can do the pop back just fine with:
[self.navigationController popToRootViewControllerAnimated:true];
but I have no idea how to send the message (a class instance) back to the root view. The application is still fresh so I can completely change the structure if this one is not correct.
The best for me would be to access the protocol class instance from everywhere (I will need it in the other UIViewController
) but I am not sure how to do that so that's why I thought of sending the message back to the root view.
If you know how to do one of the two above please give me a hand!
Cheers.
EDIT: Technically the NavigationController
is the initial ViewController
so I am not really sure who is the RootViewController
anymore.