Unable to save UIImage in a SQlite DB as a Blob

I am doing an inline string and everything gets save correctly except for the png image.   When I look in the database I see “3344645 bytes” and not all the bytes like I am suppose to.  I have manually inserted an image through my db viewer and can see that it is being stored wrong.

is UIImagePNGRepresentation(receiptImage) how I am suppose to enter it?  receiptImage is a UIImage()

 

oneStepDBTable(“INSERT INTO receiptInfo (UPLOADED, RECEIPTDATE, PURCHASEDFROM,” +

  “AMOUNT, ACCOUNTUSED, REASON, RECEIPTIMAGE) VALUES (‘0’,'(receiptDate!.text!)'” +

  “,'(purchasedFrom!.text!)’ ,'(lblReceiptAmount!.text!)’ ,'(accountID)’  ,” +

  “‘(receiptDetails!.text!)’ ,'(UIImagePNGRepresentation(receiptImage)!)’)”)

 

Any guidance would be greatly appreciated!

Powered by WPeMatico

About

You may also like...

Comments are closed.