xcode将图像保存到库中的特定文件

时间:2015-07-21 12:07:19

标签: ios xcode6 assets photos

我想将图像保存到具有特定名称的Assets库。或者到照片库。我认为这是一回事。我希望能够像" file1.png"一样保存文件。到目前为止,我尝试使用writeToFile方法,但我无法正确使用路径。

1 个答案:

答案 0 :(得分:0)

希望这可以帮助你:

       NSString  *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Test.png"]; // identity the home directory and file name

      [data writeToFile:path atomically:YES];

       NSString *imageFile = [@"file://" stringByAppendingString:path];
       NSLog(@"----imageFile path--%@",imageFile);  
相关问题