1.//NSData转换为UIImage NSData *imageData = [NSData dataWithContentsOfFile: imagePath]; UIImage *image = [UIImage imageWithData: imageData]; 2.//UIImage转换为NSData NSData *imageData = UIImagePNGRepresentation(image);