1
我有两个数组看起来像这样一个的plist:的Xcode - 写入,删除到PList
我目前加载像这样的plist:
// Find path of plist
NSString *path = [[NSBundle mainBundle] pathForResource:@"nameofPList" ofType:@"plist"];
// Read the data into arrays
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
NSMutableArray *tableData = [dict objectForKey:@"array2"];
- 怎么办我将新项目写入plist中的“array2”数组(代码,不是手动)
- 如何从“array2”中删除项目? (代码,不是手动)
谢谢。
我想知道这个编辑是否也会反映在plist中。我正在尝试相同的bt通过代码的数组中的任何更改都不会反映在plist中... – luckyShubhra
是的,它会在您执行'[tableData writeToFile:atomically:]'时执行。 – trojanfoe
谢谢你.. :)我应该通过plist名称作为参数..在写入文件..? – luckyShubhra