2015-07-21 73 views
0

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

+0

请再具体些,因为你的问题是不明确的,你要保存的图像在相机胶卷照片或文件目录 – Aladin

+0

@Aladin我同意。并请显示你已有的东西。 –

回答

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); 
相关问题