当我启动它时,UILocalNotification会崩溃我的应用程序

时间:2022-10-18 20:44:55

I can enable an UILocalNotification in my application, I proceed like this:

我可以在我的应用程序中启用UILocalNotification,我这样做:

in my UIViewController

在我的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];
    }

in Appdelegate:

在Appdelegate:

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

When the notification appears, I launch the app, I enter into the delegate correctly but after that, the application crash.

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

I work in IO6

我在IO6工作

Can you help me ?

你可以帮我吗 ?

1 个解决方案

#1


1  

for fineding creash you can do this following step for profile project like:-

对于精简粉碎,您可以执行以下步骤进行配置文件项目,例如: -

in Xcode-->Product-->choose profile.

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

wait till project runs in instruction Zombies. press on Profile you found your simulator as normal run. when your app Cresh you just select consol like:-

等到项目在指令Zombies中运行。按下配置文件,您发现您的模拟器正常运行。当你的应用程序Cresh你只需选择像: -

当我启动它时,UILocalNotification会崩溃我的应用程序

you found where is crash log with variable hope you got it

你发现崩溃日志在哪里变量希望你得到它

#1


1  

for fineding creash you can do this following step for profile project like:-

对于精简粉碎,您可以执行以下步骤进行配置文件项目,例如: -

in Xcode-->Product-->choose profile.

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

wait till project runs in instruction Zombies. press on Profile you found your simulator as normal run. when your app Cresh you just select consol like:-

等到项目在指令Zombies中运行。按下配置文件,您发现您的模拟器正常运行。当你的应用程序Cresh你只需选择像: -

当我启动它时,UILocalNotification会崩溃我的应用程序

you found where is crash log with variable hope you got it

你发现崩溃日志在哪里变量希望你得到它