1

I have some Objective-C code which registers for notifications like this:

@implementation MyClass

- (id)init
{
    self = [super init]
    [[NSDistributedNotificationCenter defaultCenter] addObserver:self
                                                     selector:@selector(onNotify:)
                                                     name:@"com.apple.screensaver.didstart"
                                                     object:nil];

}

- (void)onNotify:(NSNotification *)aNotification
{
    // do something with notification
}

@end

This works absolutely fine when compiled into an app, but I do not get any notifications when compiled into a dylib which is then loaded into an app.

Any ideas?

snowcrash09
  • 4,694
  • 27
  • 45

0 Answers0