Created
October 24, 2017 11:05
-
-
Save snosrap/ffb1124312985f89476387a37b2a341f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface FPDistributedNotificationCenter : NSObject | |
@end | |
@implementation FPDistributedNotificationCenter | |
- (id)init { | |
if(self = [super init]) { | |
[NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(receivedDistributedNotification:) name:nil object:nil]; | |
} | |
return self; | |
} | |
- (void)dealloc { | |
[NSDistributedNotificationCenter.defaultCenter removeObserver:self]; | |
} | |
- (void)receivedDistributedNotification:(NSNotification *)notification { | |
NSLog(@"%@\n%@\n%@", notification.name, notification.object, notification.userInfo); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://lists.apple.com/archives/cocoa-dev/2011/Nov/msg00158.html