0

I'm trying to pass an NSManagedObject to userInfo of UILocalNotification, something like:

NSManagedObject *obj = ...;

UILocalNotification* localNotification = [[[UILocalNotification alloc] init] autorelease];
localNotification.userInfo = [NSDictionary dictionaryWithObjectsAndKeys:obj, @"KeyName", nil];

but it crashed with below error

Property list invalid for format: 200 (property lists cannot contain objects of type 'CFType') *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'unable to serialize userInfo: (null)'

To my understanding, the root cause is that NSManagedObject is not serializable, so how to fix this issue? any workaround here?

I have also tried NSManagedObjectID, and got same error here.

Yuwen Yan
  • 4,777
  • 10
  • 33
  • 63

0 Answers0