How to save NSManagedObject in userdefaults
Hi all,
How can I save an NSManag开发者_如何学CedObject
in userDefault
.
Any help will be greatly appreciated, Thanks in advance.
You can get the ObjectID
, transform into NSURL
using the URIRepresentation
, and then archive it in a NSData
using the NSKeyedArchiver
. Now you can save it in the userdefaults.
精彩评论