Currently, I have a tableView which is loaded from the following array called exerciseArray:
if (exerciseArray == nil)
{
NSString *path = [[NSBundle mainBundle]pathForResource:@"data" ofType:@"plist"];
NSMutableArray *rootLevel = [[NSMutableArray alloc]initWithContentsOfFile:path];
self.exerciseArray = rootLevel;
[rootLevel release];
}
However, I want an option to let the user add their own data which will need to be displayed in this same table view. I can either add that data to the original plist but I think it will be better to create a separate plist that will have the user added data.
So after the user adds data, the I will need to combine the 2 plist data next time. Any idea how to implement this? The user added data will need to match up with original plist structure which looks like:

The new plist should only have ExerciseName and musclename, but I need to merge the two somehow.
The user-defined Property List should be stored in a file somewhere in the Documents directory. Usually, for something like this, I would suggest creating a copy of the default Plist that ships with the app to the Documents directory, then modifying and loading this file as needed. Copying the resource to the documents directory can be done as follows:
The above code simply finds the path to the plist in the documents directory, and checks if it exists. If it does not, it copies the data.plist resource over to the documents directory. Once this is done, it loads the root element into a mutable array, which you can then use and modify using the standard
addObject:andremoveObject:methods.Finally, to save any modified data, simply write the
rootarray back to the plist file as follows:The only delemma with this is, while in the process of developing the app, you may wish to change or modify some data in the data.plist resource. In order for the app to copy this newly modified Property List to the documents directory, you will need to uninstall it completely from the iOS Simulator, then re-compile and run.
Edit: In order to add an exercise to an existing muscle, just do something like this: