How to display a base64 image within a UIImageView?

后端 未结 11 2203
攒了一身酷
攒了一身酷 2020-11-30 00:56

I got this Base64 gif image:

R0lGODlhDAAMALMBAP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAACH5BAUKAAEALAAAAAAMAAwAQAQZMMhJK7iY4p3nlZ8XgmN         


        
11条回答
  •  甜味超标
    2020-11-30 01:51

    1. Decode Base64 to raw binary. You're on your own here. You might find cStringUsingEncoding: of NSString useful.
    2. Create NSData instance using dataWithBytes:length:
    3. Use [UIImage imageWithData:] to load it.

提交回复
热议问题