iPhone How to get image back from NSData

12,759

Solution 1

have you tried +[UIImage imageWithData:]?

Solution 2

UIImage *img=[UIImage imageWithData:data];
[yourImageView setImage:img];
Share:
12,759
ios
Author by

ios

Updated on July 05, 2022

Comments

  • ios
    ios almost 2 years

    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.