Objective-c ios将base64字符串保存到png文件
因此,我正在使用一个 Web api,它返回表示 PNG 图像文件的 base64 字符串。
我必须(出于安全原因)将其保存到 SQLite。当需要图像时,我将读取图像并将其临时保存到文件系统中。
我的计划是将其作为 Base64 字符串保存在数据库中,然后在需要时抓取字符串 Base64 对其进行解码(以某种方式)并保存到文件系统。
关于我该如何解决这个问题有什么想法吗?我看过一些指南/帖子,但似乎仍然无法弄清楚。我知道 NSData 应该混合在一起,但我认为我做错了。
任何想法表示赞赏,谢谢:)
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 guides/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 :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 base64 的内容,您可能会在这里找到所需的内容:How do I do base64编码在 iphone-sdk 上?
For the base64 stuff you'll probably find what you need here: How do I do base64 encoding on iphone-sdk?