I am attempting to send and receive messages through NSNotificationCenter
in Objective-C. However, I haven\'t been able to find any examples on how to do this.
There is also the possibility of using blocks:
NSOperationQueue *mainQueue = [NSOperationQueue mainQueue];
[[NSNotificationCenter defaultCenter]
addObserverForName:@"notificationName"
object:nil
queue:mainQueue
usingBlock:^(NSNotification *notification)
{
NSLog(@"Notification received!");
NSDictionary *userInfo = notification.userInfo;
// ...
}];
Apple's documentation