注册一个Notification
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receivedNotification:)
name:@"Address Found"
object:nil];
激发一个Notification
[[NSNotificationCenter defaultCenter] postNotificationName:@"Address Found" object:self];
响应函数
- (void)receivedNotification:(NSNotification *) notification {
if ([[notification name] isEqualToString:@"Address Found"]) {
//do something;
}
}