【问题标题】:UILocalNotification crashes my application when I start itUILocalNotification 在我启动它时使我的应用程序崩溃
【发布时间】:2013-02-27 10:05:45
【问题描述】:

我可以在我的应用程序中启用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 工作

你能帮帮我吗?

【问题讨论】:

  • 什么是崩溃信息?粘贴日志...
  • 在哪一行崩溃了?什么是崩溃日志?
  • 没有消息,有无数个断点(EXC_BAD_ACCESS)
  • 放回; [[UIApplication sharedApplication] scheduleLocalNotification:localNotif] 之后;或者还检查您没有释放任何可以在释放后在方法中使用的变量
  • 解决方法在这个主题:[iOS app crash on resuming][1] [1]: stackoverflow.com/questions/12601406/…

标签: iphone ios6 crash uilocalnotification


【解决方案1】:

对于细化崩溃,您可以对配置文件项目执行以下步骤,例如:-

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

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

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

【讨论】:

  • 对于僵尸我有消息“[UITextField _applicationResuming:]: message sent to deallocated instance 0x24a22d00”
  • 好的,我的朋友现在你只需要访问这个stackoverflow.com/questions/12601406/… :)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-12-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多