标签:io os sp on bs ad ef as res
注册一个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;
}
}
标签:io os sp on bs ad ef as res
原文地址:http://www.cnblogs.com/scaptain/p/4103933.html