【发布时间】:2011-01-09 01:25:03
【问题描述】:
你能帮帮我吗?
我正在设置一个 UILocalNotification,当我尝试设置它的 userInfo 字典时它崩溃了。 fetchedObjects 包含 88 个对象。
代码如下:
NSDictionary* myUserInfo = [NSDictionary dictionaryWithObject: fetchedObjects forKey: @"textbody"];
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
return;
// défining the interval
NSTimeInterval oneMinute = 60;
localNotif.timeZone = [NSTimeZone localTimeZone];
NSDate *fireDate = [[NSDate alloc]initWithTimeIntervalSinceNow:oneMinute];
localNotif.fireDate = fireDate;
localNotif.userInfo = myUserInfo; //this is the line that crashes the app
[fetchedObjects release];
控制台给了我这个:
Property list invalid for format: 200
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'unable to serialize userInfo: (null)'
有什么想法吗?
【问题讨论】:
标签: iphone dictionary