我在用户离线时发送通知,即聊天应用。
我在didReceiveRemoteNotification
收到消息,并在其中点火通知
NSMutableDictionary *foo = [[NSMutableDictionary alloc] init];
[foo setObject:strBadgeNumber forKey:kBadgeNumber];
[[NSNotificationCenter defaultCenter] postNotificationName:kNoti_BadgeNumber object:nil userInfo:foo];
我收到viewcontroller
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(setView:) name:kNoti_BadgeNumber object:nil];
但我在didReceiveRemoteNotification
方法崩溃了,这里是错误:
2016-08-12 12:31:59.246 [4788:1586454] -[NSConcreteNotification _setViewDelegate:]: unrecognized selector sent to instance 0x14ea1a10
2016-08-12 12:31:59.247 [4788:1586454] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteNotification _setViewDelegate:]: unrecognized selector sent to instance 0x14ea1a10'
这有什么不对?