I've used NSNotificationCenter for application-wide messaging before but today I found a strange loophole. Working on a client's project there are a few UIView subclasses that will need to receive NSNotifications that I am already posting/receiving elsewhere in the app.
I'm calling addObserver:self from the init method and using #defined constants for the notification name. When the notification I registered to receive gets posted every other object that is listening (all UIViewController subclasses) gets the notification except for my UIView subclass.
Has anyone used NSNotificationCenter from within a UIView subclass successfully? I've tried breakpoints and NSLogs but my @selector is never getting called.
EDIT- The view was being created with loadNibNamed: and initWithCoder: wasn't implemented in the class. Registering for notification inside initWithCoder: works great.
initorinitWithFrame? - hgwhittle-initoverride, the notification constants, and your handler method) that you use? - Tim