Objective-c ios save base64 string to png file
So i'm working with a web api that returns a base64 string representing a PNG image file.
I must (for security reasons) save this to SQLite. When the image is required I will then read the image and save it to the filesystem temporarily.
My plan is to keep it in the database as a Base64 string then when it's needed grab the string base64 decode it (somehow) and save to filesystem.
Any ideas on how I can go about this? I have looked at a few gui开发者_开发知识库des/posts and still can't seem to figure it out. I know NSData should be in the mix but I think i'm doing it wrong.
Any idea's appreciated, thanks :)
For the base64 stuff you'll probably find what you need here: How do I do base64 encoding on iphone-sdk?
精彩评论