iphone - NSNotification not being received in a UIViewController whose view is a subview of a UIScrollview -


i'm trying subscribe myviewcontroller custom nsnotification. view heirarchy looks this:

 window    - rootviewcontroller.view       - scrollview           - myviewcontroller.view  

the notification being sent [nsnotificationcenter defaultcenter] button inside rootviewcontroller's view. rootviewcontroller listens notification , responds fine.

i have same exact "listening" code inside myviewcontroller, it's not receiving notification reason. if it's part of app should receive notification, correct? have debug message inside myviewcontroller's initwithnibname method, know it's subscribing notification. tried having myviewcontroller listen notifications setting notification name nil. example:

 nslog(@"main view controller initialized");  [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(statusbarvisibilitychanged:) name:nil object:nil];  

but no luck there either. has seen happen before nsnotifications?

any ideas?

thanks!

i guess view controller deallocated. it's common mistake not retain view controller when creating programmatically.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -