localNotificationsアプリがバックグラウンドに移行する前に、スケジュールをすべて保存したいと考えています。
localNotificationからすべてを取得し、次のUIApplicationように保存しようとします:
NSArray *allNot =[[UIApplication sharedApplication] scheduledLocalNotifications];
UILocalNotification *not = [allNot objectAtIndex:0];
[[NSUserDefaults standardUserDefaults] setObject:not forKey:@"notifications"];
[[NSUserDefaults standardUserDefaults] synchronize];
今、問題が発生します。
クラス 'UIConcreteLocalNotification' の非プロパティ値を挿入しようとしています。
my からローカル通知[UIApplication sharedApplication] scheduledLocalNotifications]を取得すると、 の配列を取得しUIConcreteLocalNotificationます。問題は、UILocalNotificationは準拠していますがNSCoding、このオブジェクトUIConcreteLocalNotificationは準拠していないことです。
どうすればこれを修正できますか?