调用后UILocalNotification会自动销毁吗?

时间:2014-01-16 01:28:02

标签: ios iphone ios7 uilocalnotification

我想知道一旦UILocalNotification被调用(用户收到通知),UilocalNotification是否会被销毁,或者它是否只是停留在内存中,直到通知总数达到64并被新安排的消息冲走。

例如,如果我在10分钟后安排了10个UILocalNotifications,那么如果我运行会发生什么

UIApplication* app = [UIApplication sharedApplication];
NSArray *notifications = [app scheduledLocalNotifications];

1 个答案:

答案 0 :(得分:0)

来自apple docs的段落

应用程序只能有有限数量的预定通知;系统保持最快的64个通知(自动重新安排的通知计为单个通知)并丢弃其余的

调用时UILocalNotification会发生什么:

当系统发送本地通知several things can happen时,具体取决于应用程序状态和通知类型......在application:didFinishLaunchingWithOptions:方法the application delegate can obtain the UILocalNotification object from the passed-in options dictionary by using the UIApplicationLaunchOptionsLocalNotificationKey键中。< / p>

代理人can inspect the properties of the notificationif the notification includes custom data in its userInfo dictionary, it can access that data and process it accordingly。另一方面,if the local notification only badges the application icon和响应中的用户启动应用程序,在选项字典中调用application:didFinishLaunchingWithOptions:方法,but no UILocalNotification object is included

相关问题