I came across an interesting problem, i have main ViewController let’s call him MainVC with navigationController and i am doing performSegueWithIdentifier from him to Mine second ViewController let’s call him SecVC. so when i am trying to do the popViewControllerAnimated i want to pass some data from the SecVC to the MainVc.. i know i can do it with appDelegate Param or with singletons class but my question is : can i do it with more Elegant solution? like i use prepareForSegue and use local parmeters..
Thank you…
The best way to do it is by using a delegate.
//SecVCDelegate.h
//SecVC.h
//SecVC.M
When ever you popViewControllerAnimated, right after it (or before it) you do this
And in the MainVC you must be certain that you implement the delegate function
//MainVC.m
To avoid any warnings you must tell that the MainVC class implements the delegate like this:
//MainVC.h