In the code below you're posting before observing
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"someName"
object:nil
userInfo:someUserInfo];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(someMethod:)
name:@"someName"
object:nil];
}
* Original * Plenty of possible issues here:
one the notification Name could be spelt wrong = @"someName" - If this is going to be observe red from other classes, think about creating an
in a .h (that both classes import) include
extern NSString * const XXXSomeNameForSomeNotification;
in the corresponding .m
NSString * const XXXSomeNameForSomeNotification = @"someName";
That's one way to ensure they're all observing/posting the right notification
If that's not your issue then try adding observing the notification from the viewDidLoad or another method that's called prior to viewDidAppear as it could be that it's not observing you notification when it's actually posted. Add break points to observe this.