/ Published in: Objective C
This code works
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
- (void)readSettings { // Get Paths NSString *settingsPath = [self.applicationDocumentsPath stringByAppendingPathComponent:@"Settings.plist"]; // Read in Default settings // Read in Current settings and merge if ([[self.settings allKeys] indexOfObject:key] != NSNotFound) { if (![[currentSettings objectForKey:key] isEqual:[self.settings objectForKey:key]]) { // Different so merge [self.settings setObject:[currentSettings objectForKey:key] forKey:key]; } } } } - (void)saveSettings { if (self.settings) { NSString *settingsPath = [self.applicationDocumentsPath stringByAppendingPathComponent:@"Settings.plist"]; [self.settings writeToFile:settingsPath atomically:YES]; } }