Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSNotificationCenter * __weak center = [NSNotificationCenter defaultCenter];
- id __block token = [center addObserverForName:@"OneTimeNotification"
- object:nil
- queue:[NSOperationQueue mainQueue]
- usingBlock:^(NSNotification *note) {
- NSLog(@"Received the notification!");
- [center removeObserver:token];
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement