i am trying to create a planner application on iphone. I would like to create a sub key/row in my plist in another view (That means, i’ll first create the structure of the plist in one view, and in the other view i would like to add another item into the already created plist). I would want my plist to look like this:
Root (Array)
Item 0 (Dictionary) ProjectName (String) Stages (Dictionary) Analysis (Array) ^Item 0 (Dictionary) Levels (String) Tools (String) ^Item 1 (Dictionary) Levels (String) Tools (String) Develop (Array) Item 1 (Dictionary) ProjectName (String) Stages (Dictionary) Analysis (Array) ^Item 0 (Dictionary) Levels (String) Tools (String) ^Item 1 (Dictionary) Levels (String) Tools (String) Develop (Array)
^ for now, i don’t have the item 0 and item 1 in my Analysis array and i would like to add it in but i don’t know the right codes to do it.
So in my first view, i would be able to add a new project and after adding, it will save in my plist as a dictionary, the first item 0 (i’ve code it that when the user saves the new project the stages dictionary with the analysis and develop array will be created in my plist as well).
— there would be item 1, item 2 and so on if the user choose to add more projects.
After the user has created(saved) a new project, he/she can go to the second view where he/she could choose a stage (Analysis/Develop).
So example, the user chooses the Analysis stage, he/she would be taken to another view which allows the user to add level(s) for the certain stage.
The problem i am facing is how am i suppose to add another dictionary item with strings into my existing Analysis stage in the plist (how to add a new value/item into an existing dictionary/array(row) in the plist)?
Thanks in advance!
If I understand you correctly you would do something like this:
Is that what you mean?
EDIT: To replace the dictionary at item 0 with a new one:
To set an individual key at item 0: