使用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
不符合。
我怎样才能解决这个问题?
没有找到相关结果
已邀请:
1 个回复
骨乏唯瓜