0

我可以UILocalNotification在我的应用程序中启用一个,我这样进行:

在我的UIViewController

if(_endDate){    
        UILocalNotification *localNotif = [[UILocalNotification alloc] init];
        if (localNotif == nil)
            return;
        localNotif.fireDate = _endDate;
        localNotif.timeZone = [NSTimeZone defaultTimeZone];

        localNotif.alertBody = @"go";
        localNotif.soundName = UILocalNotificationDefaultSoundName;
        localNotif.applicationIconBadgeNumber = 1;

        [[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
    }

Appdelegate

-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{
    application.applicationIconBadgeNumber = 0;
}

当通知出现时,我启动了应用程序,我正确地进入了委托,但在那之后,应用程序崩溃了。

我在IO6工作

你能帮助我吗 ?

4

1 回答 1

2

对于罚款,您可以对配置文件项目执行以下步骤,例如:-

在 Xcode--> 产品--> 选择配置文件中。

等到项目在指令僵尸中运行。按 Profile 你发现你的模拟器正常运行。当您的应用 Cresh 时,您只需选择 consol,例如:-

在此处输入图像描述

你找到了带有变量的崩溃日志希望你明白了

于 2013-02-27T10:23:21.873 回答