NSDistributedNotificationCenter not working for dylib

I have Objective-C code that registers for such notifications:

@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 great when compiling into an application, but I don't get any notifications when compiling into dylib, which is then loaded into the application.

Any ideas?

+1
source share

Source: https://habr.com/ru/post/906156/


All Articles