I don't want to use NSUserDefaults
, so how do I save an image in core data then retrieve it?
My image is in this variable.
var image:UIIMage = image1
Can you please give me some sample code to do this?
I don't want to use NSUserDefaults
, so how do I save an image in core data then retrieve it?
My image is in this variable.
var image:UIIMage = image1
Can you please give me some sample code to do this?
UIImage -> NSData
NSData *imageData = UIImagePNGRepresentation(image); or UIImageJpegRepresentation(image)
NSData -> UIImage
UIImage *image=[UIImage imageWithData:data];
Convert UIImage
into NSData
and save as the entity's attribute with the type Binary Data
this question is already answered by stack-overflow refer this