I've strange problem. In ViewController.m
, I post notification after successful save and perform Segue to ListViewController
. In ListViewController.m
, I set up observer in viewDidLoad
and declare method for handling.
The problem is that handler method is called but no code inside is executed! Any idea why?
// ViewController.m
if (success) {
[[NSNotificationCenter defaultCenter] postNotificationName:kAHPlistSavedSuccessfully object:self];
[self performSegueWithIdentifier:kAHDetailToListSegue sender:self];
}
// ListViewController.m
- (void)viewDidLoad
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(plistSavedSuccessfully:) name:kAHPlistSavedSuccessfully object:nil];
}
- (void)plistSavedSuccessfully:(NSNotification *)notification
{
NSLog(@"notification %@", notification);
[self someMethod]; // not called !
}