How do I detect when a certain view appears while the app is running? e.g. in a tab bar app let's say we have 2 bars "Results" and "Edit" - the app loads with results and there is nothing. Now, users goes to edit and makes some magic. Then, he presses the results bar again, and he will see the results. In other words, I need to pass the information from "edit" view controller to "results" view controller when the results bar is pressed. I hope I made this clear. Thanks in advance!
Asked
Active
Viewed 496 times
1 Answers
2
There's a few ways to approach this problem.
1) you could keep a handle (or pointer, or property) to the "Results" view controller from your "Edit" view controller and when you want to send data to "Results", that'll be easy to do (via a method or a delegate protocol).
2) you could register the "Results" view controller for notifications and then when you want to update it with any new data, populate your fields when the proper notification comes in. And over in your "Edit" view controller, post a notification with a dictionary and/or object that encapsulates the results you want to display.
And there's more!

Michael Dautermann
- 88,797
- 17
- 166
- 215
-
is there any useful resource that could help me in my particular case? – nemesis Apr 26 '12 at 20:47
-
[Here is a related question (on NSNotification) with answers that may help you out](http://stackoverflow.com/questions/7161307/how-to-use-nsnotification). – Michael Dautermann Apr 26 '12 at 21:13