Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在xcode的documnet目录中创建了一个plist名称infoD.plist,就像他的形象
在某些情况下,我只想在我的代码中将 NO 更改为 YES。我需要这样
infoD plist objectAtIndex:10 to YES if purchased.if the user purchased something ,i need to chnage the iteam10 value to YES. how to do this.
提前致谢。
使用 NSMutableDictionary 抓取你的 plist 的 plist 内容
NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithContentsOfFile:<filepath>]; [dict setValue:[NSNumber numberWithBool:YES] forKey:@"item 10"]; [dict writeToFile:<filepath> atomically:YES];