【发布时间】:2011-01-13 12:41:45
【问题描述】:
我正在努力
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 协议并且应该被序列化。
有人可以帮帮我吗?
【问题讨论】: