Apple のサンドボックス ガイドは非常に便利で、ここにあります。
ここで私の質問に答えて theAmateurProgrammer が説明したように、基本的にアプリ専用のフォルダーがあります。
~/Library/Container/com.yourcompany.yourappname/
これが私がこれまでに持っているものです。後で改善します。
//Create App directory if not exists:
NSFileManager* fileManager = [[NSFileManager alloc] init];
NSString* bundleID = [[NSBundle mainBundle] bundleIdentifier];
NSArray* urlPaths = [fileManager URLsForDirectory:NSApplicationSupportDirectory
inDomains:NSUserDomainMask];
NSURL* appDirectory = [[urlPaths objectAtIndex:0] URLByAppendingPathComponent:bundleID isDirectory:YES];
//TODO: handle the error
if (![fileManager fileExistsAtPath:[appDirectory path]]) {
[fileManager createDirectoryAtURL:appDirectory withIntermediateDirectories:NO attributes:nil error:nil];
}