【发布时间】:2013-07-13 07:06:26
【问题描述】:
我正在设置 UILocalNotification 来通知用户某个事件。
我的问题是模拟器在设置通知并关闭应用程序后崩溃并显示消息“Thread 1:signal SIGKILL”。
我知道this 的答案,但我没有在 userinfo 字典中存储任何内容。
代码如下:
NSDate *alertTime = [[NSDate date]
dateByAddingTimeInterval:10];
UIApplication* app = [UIApplication sharedApplication];
UILocalNotification* notifyAlarm = [[UILocalNotification alloc] init];
if (notifyAlarm)
{
notifyAlarm.fireDate = alertTime;
notifyAlarm.timeZone = [NSTimeZone defaultTimeZone];
notifyAlarm.repeatInterval = 0;
notifyAlarm.alertBody = @"Testing notification.";
[app scheduleLocalNotification:notifyAlarm];
NSLog(@"Notification set");
}
您知道为什么会发生这种情况吗?
谢谢
【问题讨论】:
-
能发下相关方法或代码吗?
-
我已经为你更新了我的问题。
-
粘贴您收到通知的代码
-
这是我唯一的代码,我没有任何其他代码用于接收通知。
-
@JakesRassie:我检查了你的代码,我没有崩溃。因此,通知接收或其他代码可能存在任何问题
标签: ios ios-simulator uilocalnotification