【发布时间】:2023-03-20 09:35:01
【问题描述】:
我正在使用我发现的这个简单方法写入 plist,但它似乎不起作用:
-(IBAction)modifyPlist:(id)sender{
NSBundle *mainBundle=[NSBundle mainBundle];
NSString *path=[mainBundle pathForResource:@"Preferences" ofType:@"plist"];
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithContentsOfFile:path];
[[dict objectForKey:@"Root"] setBool:YES forKey:@"startup"];
}
我做错了什么? 谢谢
【问题讨论】:
标签: objective-c xcode cocoa