0
我试图在iOS5模拟器上更新现有的plist
,但它失败了。在iOS5模拟器上更新现有的plist
它找到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];