From 3bc298e6cb16870ff644971633b60728c0aa422c Mon Sep 17 00:00:00 2001 From: Kilian Hofmann Date: Wed, 23 Mar 2016 22:04:45 +0100 Subject: [PATCH] Method to load file implemented, not accessible by app yet --- FMC Planner 2/ViewController.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/FMC Planner 2/ViewController.m b/FMC Planner 2/ViewController.m index cfc5087..4d709ea 100644 --- a/FMC Planner 2/ViewController.m +++ b/FMC Planner 2/ViewController.m @@ -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