- (void)saveImage:(UIImage *)tempImage WithName:(NSString *)imageName
{
NSData * imageData = UIImagePNGRepresentation(tempImage);
NSArray * paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString * documentsDirectory = [paths objectAtIndex:0];
// Now we get the full path to the file
NSString * fullPathToFile = [documentsDirectory stringByAppendingString:imageName];
// and then we write it out
[imageData writeToFile:fullPathToFile atomically:NO];
// NSLog(@"路径:%@", [NSHomeDirectory() stringByAppendingPathComponent:@"Documents1.png"]);
// 将存入到沙盒的图片再取出来,目的是为了进行上传
NSLog(@"fullPathToFile:%@", fullPathToFile);
NSString * path = fullPathToFile;
// 二进制的数据就可以进行上传
NSData * data = [NSData dataWithContentsOfFile:path];
UIImage * image = [UIImage imageWithData:data];
self.postImage.image = image;
}