我正在尝试更新现有plist
的 iOS5 模拟器,但它失败了。
它找到 plist 并检索现有信息并更新数组,但它不写入文件。
有人会有什么想法吗?
NSString *path = [[NSBundle mainBundle] pathForResource:@"content_iPhone" ofType:@"plist"];
NSMutableArray *plist = [[NSMutableArray arrayWithContentsOfFile:path] mutableCopy];
// For testing purpose, get an object from the Array and add the object to array
newObject = [plist objectAtIndex:1];
[plist addObject:newObject];
[plist writeToFile:path atomically:YES];