IOS把文件保存进沙盒目录

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);

NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"a.jpg"]];   // 保存文件的名称

BOOL result = [UIImagePNGRepresentation(original)writeToFile: filePath atomically:YES];  

如果成功result为TRUE,filePath即为访问目录

 

转载于:https://www.cnblogs.com/punkrocker/p/4084268.html

你可能感兴趣的:(IOS把文件保存进沙盒目录)