iphone开发必知点之--清除和设置桌面提示泡泡计数

当app重新打开或切换到前台时,在app委托applicationWillEnterForeground:方法里实现

清除泡泡计数

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // clear badage
    [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
}

在app被激活时,设置泡泡计数

- (void)applicationDidBecomeActive:(UIApplication *)application
{
  
NSInteger testBadgeNum = 10;
  [[UIApplication sharedApplication] setApplicationIconBadgeNumber:testBadgeNum]; 

}
posted @ 2012-07-12 13:06  月光的尽头  阅读(517)  评论(0编辑  收藏  举报