NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
settingsPlistPath = [[documentsDirectory stringByAppendingPathComponent:@"Settings.plist"] copy];
NSFileManager *fileManager = [[NSFileManager alloc] init];
if (![fileManager fileExistsAtPath:settingsPlistPath]) {
NSString *bundledSettings = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"plist"];
[fileManager copyItemAtPath:bundledSettings toPath:settingsPlistPath error:NULL];
}
self.settingsDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:settingsPlistPath];
NSString *documentsDirectory = [paths objectAtIndex:0];
settingsPlistPath = [[documentsDirectory stringByAppendingPathComponent:@"Settings.plist"] copy];
NSFileManager *fileManager = [[NSFileManager alloc] init];
if (![fileManager fileExistsAtPath:settingsPlistPath]) {
NSString *bundledSettings = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"plist"];
[fileManager copyItemAtPath:bundledSettings toPath:settingsPlistPath error:NULL];
}
self.settingsDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:settingsPlistPath];