converting byte array coming from server to image and storing in SQLITE database --OBJECTIVE-C
I am using FMDB wrapper to store data in sqlite. I am facing problem when I am trying to store the images which comes from server to the database. the image data is in byte array format and I am storing the bytearray into NSData and storing the NSData into the sqlite database.the column that I am storing it into is of type blob. when I do select * from tablename --I get the byte array which should not be the case.
Just to test I created a sample project and in that开发者_JS百科 I tried to store an image which is in my resources folder into the sqlite database. when I did select * from tablename I got "firtname|?PNG" which means the image is stored in png format. now I need to know how I can convert the byte array that comes from server into an image format.
I strongly recommend you to store the images outside the database. Store only file names there.
精彩评论