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];