在didReceiveRemoteNotification

时间:2016-08-12 07:05:56

标签: ios objective-c nsnotificationcenter

我在用户离线时发送通知,即聊天应用。

我在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'

这有什么不对?

0 个答案:

没有答案