typedef void (^MyTestBlock)(void);
MyTestBlock myBlock = ^void() {
// your implementation
}];
2. Consumer
[[NSNotificationCenter defaultCenter] addObserverForName:@"key" object:nil queue:nil usingBlock:^(NSNotification *note) {
myBlock();
}];
3. Trigger
[[NSNotificationCenter defaultCenter] postNotificationName:@"key" object:nil userInfo:nil];
No comments:
Post a Comment