Method to load file implemented, not accessible by app yet

This commit is contained in:
Kilian Hofmann 2016-03-23 22:04:45 +01:00
parent ad1381d5df
commit 3bc298e6cb

View File

@ -52,4 +52,15 @@
}
}
- (void)loadSave:(NSString *)file {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0];
NSString *filePath = [documentsPath
stringByAppendingString:[NSString stringWithFormat:@"/%@", file]];
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
_save = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
}
}
@end