【发布时间】:2015-07-08 10:50:16
【问题描述】:
我正在尝试将 NSManagedObject 传递给 UILocalNotification 的 userInfo,类似于:
NSManagedObject *obj = ...;
UILocalNotification* localNotification = [[[UILocalNotification alloc] init] autorelease];
localNotification.userInfo = [NSDictionary dictionaryWithObjectsAndKeys:obj, @"KeyName", nil];
但它因以下错误而崩溃
属性列表格式无效:200(属性列表不能包含“CFType”类型的对象) *** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“无法序列化 userInfo:(null)”
据我了解,根本原因是 NSManagedObject 不可序列化,那么如何解决这个问题?这里有什么解决方法吗?
我也尝试过 NSManagedObjectID,在这里也遇到了同样的错误。
【问题讨论】:
-
谢谢@Rohitsuvagiya,我知道根本原因,我想在这里询问解决方案。
标签: ios objective-c core-data uilocalnotification nsnotification