相关疑难解决方法(0)

UILocalNotification崩溃

请你帮助我好吗 ?

我正在设置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];
Run Code Online (Sandbox Code Playgroud)

而控制台给了我这个:

Property list invalid for format: 200
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'unable to serialize userInfo: (null)'
Run Code Online (Sandbox Code Playgroud)

任何的想法 ?

iphone dictionary

3
推荐指数
2
解决办法
3416
查看次数

标签 统计

dictionary ×1

iphone ×1