Advertisement
undeadhip

Untitled

Jun 29th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NSNotificationCenter * __weak center = [NSNotificationCenter defaultCenter];
  2. id __block token = [center addObserverForName:@"OneTimeNotification"
  3.                                        object:nil
  4.                                         queue:[NSOperationQueue mainQueue]
  5.                                    usingBlock:^(NSNotification *note) {
  6.                                        NSLog(@"Received the notification!");
  7.                                        [center removeObserver:token];
  8.                                    }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement