//添加监听者
NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
[defaultCenter addObserver:self selector:@selector(networkDidReceiveMessage:)
name:kJPFNetworkDidReceiveMessageNotification object:nil];
//在APP打开的情况下,接收自定义的方法
- (void)networkDidReceiveMessage:(NSNotification *)notification {
//处理通知的方法
NSDictionary *userInfo = [notification userInfo];
}
---------------------
作者:京津追梦人
来源:CSDN
原文:https://blog.csdn.net/wwc455634698/article/details/55257904
版权声明:本文为博主原创文章,转载请附上博文链接!