Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter a signature. When the user is finished entering the signature i want to save it away to the database. I want to know if it is possible to save a UIImage to a string at all? And than also reload the UIImage from the string?
Thanks in advance
You should save your UIImage object as a Base64 string:
Convert UIImage to NSData using UIImageJPEGRepresentation
Convert NSData to Base64 string and then save the encoded string into database.
To load the image, reverse the process.
Create a NSData object from saved Base64 encoded string.
Use [UIImage initWithData] to initial an UIImage object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With