I\'m reading into my application a plist which at the top level is an array. It\'s simple enough to make sure the array starts as mutable
self.plistData = [
The simplest approach is to use NSPropertyListSerialization
and passing the proper options to get mutable containers.
NSString *path = [[NSBundle mainBundle] pathForResource:@"myDataSource" ofType:@"plist"];
NSData *data = [NSData dataWithContentsOfFile:path];
NSMutableArray *array = [NSPropertyListSerialization propertyListWithData:data options:NSPropertyListMutableContainers format:nil error:nil];
self.plistData = array;
Ideally you will make use of the error
parameter and do proper error checking but this will get you started.
This code will load the plist and return a mutable array and every contained array and dictionary will also be mutable.