+ (NSString *)getFilePath
{
NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) objectAtIndex:0] stringByAppendingPathComponent:@"photo.plist"];
if ([[NSFileManager defaultManager] fileExistsAtPath:path] == NO)
{
NSFileManager* fileManager = [NSFileManager defaultManager];
//if(IOS7)
[fileManager createFileAtPath:@"photo.plist" contents:nil attributes:nil];
//if(IOS8)
[fileManager createFileAtPath:path contents:nil attributes:nil];
NSMutableArray *photoPathArray = [NSMutableArray array];
[photoPathArray writeToFile:path atomically:YES];
}
return path;
}
原文地址:http://my.oschina.net/751547752/blog/317217