How to Get UIImage from a 'Base64String' format raw image data, on iPhone?

前端 未结 1 1232
猫巷女王i
猫巷女王i 2021-01-15 23:18

In my application, I receive the image data from the server in a XML file. This data is of an image( .jpeg or .png or .tiff etc) which the server, converts into \'Base64Stri

相关标签:
1条回答
  • 2021-01-16 00:22

    This page on the CocoaDev wiki contains several implementations of base64 decoding from strings. The NSData category at the bottom of the page is probably the simplest to integrate in your application.

    From there, you can extract an NSData representation of your base64-encoded string. The NSData can be used to initialize a UIImage instance using the UIImage imageWithData: or initWithData: constructors.

    0 讨论(0)
提交回复
热议问题