Skip to content

Instantly share code, notes, and snippets.

View gist:1412548
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSFileManager *fileManager = [[NSFileManager alloc] init];
if (![fileManager fileExistsAtPath:documentsDirectory]) {
[fileManager createDirectoryAtPath:documentsDirectory withIntermediateDirectories:YES attributes:nil error:nil];
}
NSString *dbFilePath = [documentsDirectory stringByAppendingPathComponent:@"high_scores.out"];
NSLog(@"%@", dbFilePath);