<span style="font-family: Arial, Helvetica, sans-serif;">1.注册NotificationCenter</span>
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationPosedAction:) name:@"notificationPosed" object:nil];
2.NotificationCenter事件
-(void)notificationPosedAction:(NSNotification *)notif{ NSString * state = [notif object]; NSLog(@"%@",state); }
3.触发事件
NSString * s = @"hehe"; [[NSNotificationCenter defaultCenter] postNotificationName:@"<span style="font-family: Arial, Helvetica, sans-serif;">notificationPosed</span><span style="font-family: Arial, Helvetica, sans-serif;">" object:s];</span>
4.移除
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"<span style="font-family: Arial, Helvetica, sans-serif;">notificationPosed</span><span style="font-family: Arial, Helvetica, sans-serif;">" object:nil];</span>
5判断推送是否打开
UIRemoteNotificationTypeNone == [[UIApplication sharedApplication] enabledRemoteNotificationTypes]