UILocalNotification当我启动它时崩溃我的应用程序 [英] UILocalNotification crashes my application when I start it

查看:259
本文介绍了UILocalNotification当我启动它时崩溃我的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在我的申请中启用 UILocalNotification ,我这样进行:



$ c> 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;
}

当通知出现时,我启动应用程序,



你能帮助我吗?

解决方案

您可以对配置文件项目执行以下步骤: -



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



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





您发现在哪里是变量的崩溃日志希望你有它


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

in my 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:

-(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

Can you help me ?

解决方案

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

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

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:-

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

这篇关于UILocalNotification当我启动它时崩溃我的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆