In my application there is two viewControllers as FirstViewController
and DetailViewController
.
When tap on a table cell, it navigate to Det
post the notification from detailViewController and add firstViewController as the observer.
Make sure you remove fireViewController from the observer list from viewDidUnload.
Right now you are adding detailViewController as observer.
-(void)viewDidLoad {
[NSNotificationCenter defaultCenter];
NSNotification* notification = [NSNotification notificationWithName:@"MyNotification" object:self];
[[NSNotificationCenter defaultCenter] postNotification:notification];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (objFirstViewController) name:@"MyNotification" object:nil];
}
-(IBAction) save{
[[NSNotificationCenter defaultCenter] postNotificationName:MyNotification object:sender];
//this will go to where you implement your selector objFirstViewController.
}
-(void)objFirstViewController:(NSNotification *)notification {
}