UILocalNotification在 iOS8中无效,这是因为Apple改变了策略,需要开发者申请注册推送,然后才
可能正常使用
只要在
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
}
中加入以下代码就可以了
[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil]];