UIImage from bytes held in NSString

前端 未结 3 1018
悲&欢浪女
悲&欢浪女 2021-02-04 21:23

I am trying to create a UIImage from a byte array that is actually held within a NSString.

Can someone please tell me how I can do that?

Here is what I was think

3条回答
  •  礼貌的吻别
    2021-02-04 21:39

    [UIImage imageWithData:data]; will return nil if it doesn't understand the data being passed to it. I would double check your encoding, etc. It's odd that a binary string would hold pure image data without some kind of encoding (base64, etc.). String encodings and binary encodings aren't compatible.

提交回复
热议问题