ios - How to pass NSManagedObject to userInfo of UILocalNotification -
i'm trying pass nsmanagedobject userinfo of uilocalnotification, like:
nsmanagedobject *obj = ...; uilocalnotification* localnotification = [[[uilocalnotification alloc] init] autorelease]; localnotification.userinfo = [nsdictionary dictionarywithobjectsandkeys:obj, @"keyname", nil];
but crashed below error
property list invalid format: 200 (property lists cannot contain objects of type 'cftype') *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'unable serialize userinfo: (null)'
to understanding, root cause nsmanagedobject not serializable, how fix issue? workaround here?
i have tried nsmanagedobjectid, , got same error here.
try matt gallagher has great blog post this: http://cocoawithlove.com/2008/08/safely-fetching-nsmanagedobject-by-uri.html
and try : error when setting userinfo in uilocalnotification
Comments
Post a Comment