Skip to content

Instantly share code, notes, and snippets.

@dnstevenson
dnstevenson / gist:1412548
Created December 1, 2011 01:24
Saving Array
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);