首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

本地推送的有关问题

2012-09-17 
本地推送的问题小弟的代码:UILocalNotification *notification [[UILocalNotification alloc] init]if

本地推送的问题
小弟的代码:
UILocalNotification *notification = [[UILocalNotification alloc] init]; 
if (notification != nil) 
{  
NSDate *now = [NSDate new];  
notification.fireDate = [now dateByAddingTimeInterval:10];  
notification.timeZone = [NSTimeZone defaultTimeZone];  
notification.alertBody = @"测试";  
notification.soundName = UILocalNotificationDefaultSoundName;  
notification.applicationIconBadgeNumber = 1;  
[[UIApplication sharedApplication] scheduleLocalNotification:notification];  
[notification release]; 
}. 
现在的问题是,程序在后台时可以弹出一个推送通知,但是手机桌面上程序的icon图标数字不能改变,这是什么原因啊?



[解决办法]
收到通知时再刷新一下图标?

热点排行