I am making one IOS application in which will be using core data and I want to save image in database can anyone tell me how to upload image in Sqlite Database Browser?
3 Answers
To store image in Sqlite Database using core data u need to convert image to data
for example
NSData *photo_data = UIImagePNGRepresentation(aImage);
Now u can store this photo_data. In core data model u create a attribute of type "Binary data"
use this attribute while storing the image data.
5 Comments
You can't just slap in an image file into sqlite. you need to transform the image into a format such as base64 or something that can be stored. when you want to retrieve the image you must transform it back into its original form. for most cases all you need to do is store the path to the image, and not the image itself.