标签:ios uiimage存为本地文件与uiimag
UIImage *image=@"XXX";
//png格式
NSData *imagedata=UIImagePNGRepresentation(image);
//JEPG格式
//NSData *imagedata=UIImageJEPGRepresentation(image);
NSArray*paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *documentsDirectory=[paths objectAtIndex:0];
NSString *savedImagePath=[documentsDirectorystringByAppendingPathComponent:@"saveFore.png"];
[imagedata writeToFile:savedImagePath atomically:YES];
本地默认存放路径:
Finder-->位置-->app(用户名)-->application support-->iphone simulator-->4.3-->Applications ->模拟器
iOS中UIImage存为本地文件与UIImage转换为NSData
标签:ios uiimage存为本地文件与uiimag
原文地址:http://blog.csdn.net/darongzi1314/article/details/42713153