我在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.
提前致谢。
答案 0 :(得分:0)
使用NSMutableDictionary来抓取你的plist
的plist内容NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithContentsOfFile:<filepath>];
[dict setValue:[NSNumber numberWithBool:YES] forKey:@"item 10"];
[dict writeToFile:<filepath> atomically:YES];