iOS10 UNNotificationRequest设置标识符为@“”,设备崩溃并不断重启

时间:2016-10-26 02:39:25

标签: ios10

我的代码是这样的:

UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init];
content.badge = @1;
content.body = @"body";
content.sound = [UNNotificationSound defaultSound];
content.subtitle = @"subtitle";
content.title = @"title";
NSDateComponents *components = [NSDateComponents new];
components.year = 2016;
components.month = 10;
components.day = 26;
components.hour = 10;
components.minute = 35;
UNCalendarNotificationTrigger *trigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:components repeats:YES];
UNNotificationRequest * request = [UNNotificationRequest requestWithIdentifier:@"" content:content trigger:trigger];
[[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {}];

我弄错了,[UNNotificationRequest requestWithIdentifier:@“”content:content trigger:trigger];用@“”设置标识符,然后在我的设备上运行。 然后我的设备崩溃并一次又一次地重启。在上面的例子中,我尝试在模拟器上运行它,模拟器一次又一次地重启,直到我重置内容和设置。

现在我的设备无法连接到计算机,因为它一次又一次地重启,我无法解锁它。所以我无法卸载错误应用程序并重置它。如何解决这个问题?

0 个答案:

没有答案