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即为访问目录

 

posted @ 2014-11-09 00:00  朋克  阅读(738)  评论(0编辑  收藏  举报