NSData to UIImage

前端 未结 5 2158
逝去的感伤
逝去的感伤 2020-11-29 08:40

I\'m trying to save a UIIMage and then retrieve it and display it. I\'ve been successful by saving an image in the bundle, retrieving it from there and displaying. My proble

5条回答
  •  悲&欢浪女
    2020-11-29 09:13

    Check this out: http://www.nixwire.com/getting-uiimage-to-work-with-nscoding-encodewithcoder/.

    It has exactly what I think the solution to your problem is. You can't just make an image out of NSData, even though that's what common sense suggests. You have to use UIImagePNGRepresentation. Let me know if this helps.

提交回复
热议问题