使用UILocalNotifications和NSUserDefaults保存localNotifications

|| 我想在应用程序进入后台之前保存所有预定的“ 0”。 我从
UIApplication
得到所有
localNotification
,然后尝试像这样保存:
NSArray *allNot =[[UIApplication sharedApplication] scheduledLocalNotifications];
UILocalNotification *not = [allNot objectAtIndex:0];
[[NSUserDefaults standardUserDefaults] setObject:not forKey:@\"notifications\"];
[[NSUserDefaults standardUserDefaults] synchronize];
现在出现了问题。   尝试插入类\'UIConcreteLocalNotification \'的非属性值。 当我从
[UIApplication sharedApplication] scheduledLocalNotifications]
得到本地通知时,我得到了
UIConcreteLocalNotification
的数组。问题在于
UILocalNotification
符合
NSCoding
,但对象
UIConcreteLocalNotification
不符合。 我怎样才能解决这个问题?     
已邀请:
        您是否投放了使用objectAtIndex:方法检索的对象?
UILocalNotification *not = (UILocalNotification *) [allNot objectAtIndex:0];
    

要回复问题请先登录注册