记录一下
//发出通知
[[NSNotificationCenter defaultCenter] postNotificationName:@"connectServerSuccess" object:self userInfo:@{@"isSuccess":@YES}];
//接收通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(connectServerSuccess:) name:@"connectServerSuccess" object:nil];
//消除通知
[[NSNotificationCenter defaultCenter] removeObserver:self];
本文介绍了NSNotification在Objective-C中的具体应用,包括如何发送、接收及移除NSNotification。通过一个简单的示例展示了NSNotification在实际开发中的作用。
115

被折叠的 条评论
为什么被折叠?



