iPhone How to get image back from NSData

自古美人都是妖i 提交于 2019-12-06 05:00:37

问题


In my iPhone App I am storing image into NSData by

UIImage *image =imageView.image;

NSData *myData = UIImagePNGRepresentation(image);

But How to get back "image" from "NSData" and I can display it again into in to UIImageView.

Please Help and Suggest, Thanks.


回答1:


have you tried +[UIImage imageWithData:]?




回答2:


UIImage *img=[UIImage imageWithData:data];
[yourImageView setImage:img];


来源:https://stackoverflow.com/questions/4655174/iphone-how-to-get-image-back-from-nsdata

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!