我的应用程序中有一个属性列表,我让它更改所有不同字段的值,但是当应用程序关闭时,所有设置都被删除。这是我正在使用的代码:
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *path = [mainBundle pathForResource:@"Settings" ofType:@"plist"];
//NSNumber *str = [dict objectForKey:@"Auto_Save"];
NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
[data setObject:[NSNumber numberWithBool:sender.on] forKey:@"Auto_Save"];
[data writeToFile:path atomically:YES];