Iphone UILocalNotification userInfo未序列化NSURL

Iphone UILocalNotification userInfo未序列化NSURL,iphone,ios4,Iphone,Ios4,我正在努力 UILocalNotification *notification = [[UILocalNotification alloc] init]; NSURL *urlForSomeObject=[[(NSManagedObject *)someObject objectID] URIRepresentation]; notification.fireDate = aDate; notification.timeZone = [NSTimeZone systemTimeZone];

我正在努力

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"];
当通知发生时,应用程序会给出异常
无法序列化userInfo:(null)
我已检查[NSDictionary dictionary WithObject:urlForSomeObject forKey:@“objectUrl”]是否返回有效的词典。 为什么会发生这种行为。就我而言,knw NSURL遵守NSCoding协议,应该序列化。
有人能帮我吗?

UILocalNotification上的userInfo字典必须只包含“plist类型”。NSURL不是plist类型。我建议将URL序列化为字典中的字符串,然后在收到通知时将其转换回NSURL。

UILocalNotification上的userInfo字典必须仅包含“plist类型”。NSURL不是plist类型。我建议将URL序列化为字典中的字符串,然后在收到通知时将其转换回NSURL