1
我試圖做UILocalNotification USERINFO不序列化NSURL
UILocalNotification *notification = [[UILocalNotification alloc] init];
NSURL *urlForSomeObject=[[(NSManagedObject *)someObject objectID] URIRepresentation];
notification.fireDate = aDate;
notification.timeZone = [NSTimeZone systemTimeZone];
notification.soundName = UILocalNotificationDefaultSoundName;
notification.applicationIconBadgeNumber = 1;
notification.userInfo=[NSDictionary dictionaryWithObject:urlForSomeObject forKey:@"objectUrl"];
時通知出現應用程序使異常 unable to serialize userInfo: (null)'
我已經檢查了[NSDictionary的dictionaryWithObject:urlForSomeObject forKey:@ 「的ObjectURL」]返回一個有效的字典。 爲什麼會發生這種行爲。據我所知NSURL堅持NSCoding協議,應該序列化。 有人可以幫我嗎?