iOS8向けplistを作成するサンプルコード

参考ソースコード
+ (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;

}

IOS

Posted by arkgame