转自:http://stackoverflow.com/questions/7773584/can-i-programmatically-clear-my-apps-notifications-from-the-ios-5-notification
To remove notifications from the Notification Center simply set your icon badge number to zero.
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
This only works if the number changes, so if your app doesn't use the badge number you have to first set, then reset it.
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
本文介绍了一种清除iOS应用通知中心的方法。通过设置应用程序图标徽章编号为零,可以实现通知的清除。需要注意的是,这种方法只有在徽章编号发生变化时才有效。如果应用本身不使用徽章编号,则需先设置一个非零值再将其重置为零。
1万+

被折叠的 条评论
为什么被折叠?



