I am working on an Iphone Application (ios5 + storyboard + arc).
I have 2 ViewControllers A and B.
In A I have a button. when pressed I am submitting a request asynchronously to the server (using AFNetworking) and I will go to View Controller B by using performSegueWithIdentifier (push not modal).
When the request finishes it executes a request successful Block that will save data to the database. (The block is in ViewController A since the request is sent from there)
Is there a way I can notify ViewController B that the request has finished and execute a method in B?
What I’m looking for is that when the request finishes and enters the Success Block I run a method in view controller B which is the loaded view.
I hope I was clear.
Thanks
For posting a notification use the below code:
In the viewDidLoad of the notification listening class add observer like:
performTask:is the method which will be called when the notification is observed.Please refer NSNotification Class Reference