源自:http://stackoverflow.com/questions/2240765/nsdata-to-uiimage
Try this code. This worked for me.
create path to save the image data.
NSArray *pathArr = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask,
YES);
NSString *path = [[pathArr objectAtIndex:0]
stringByAppendingPathComponent:@"img.data" ];
convert the image to NSData object
NSData* data = UIImageJPEGRepresentation(myImage, 1.0);
[data writeToFile:path atomically:YES];
retrieve the saved data
NSData *retrievedData = [NSData dataWithContentsOfFile:path];
Create an imageview
UIImageView *imgv = [[UIImageView alloc]
initWithFrame:CGRectMake(100, 100, 200, 200)];
load the imageview with the retrieved data
imgv.image = [UIImage imageWithData:retrievedData];
[self.view addSubview:imgv];
[imgv release];