我可以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工作
你能帮助我吗 ?