如何将NSData值转换为UIImage

时间:2012-04-11 07:16:44

标签: ios uiimage nsdata

  

可能重复:
  NSData to UIImage

如何将NSData值转换为UIImage?

1 个答案:

答案 0 :(得分:30)

您可以从UIImage获取NSData,如下所示:

NSData *data = yourData;

UIImage *image = [UIImage imageWithData:data];

NSData *data = yourData;

UIImage *image = [[UIImage alloc] initWithData:data];
....
[image release];