我想localNotifications在应用程序进入后台之前保存我所有的计划。
我得到了所有的localNotification,UIApplication我尝试保存:
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不是。
我怎样才能解决这个问题?