I have a IOS plist generated by a third party’s app I am trying to interface to, consequently I cannot modify the format of the plist. The part that is giving me trouble is an array of Dictionaries, the cardList array. I have loaded the plist into a NSMutableDictionary with no problem and can ‘dump’ the cardList and colorLabelList arrays.
First Question: What is the best way to access each member of the Item array’s? i.e., draft, label, etc. for each of the cards in the list.
2nd Question: Is my ‘loading into a NSMutableDictionary’ approach the best choice?
Here is the layout of the plist:
cardlist Array
item 0 Dictionary
draft boolean
label string
notes string
...
item 1 Dictionary
draft
label
notes
...
name string
sortOrder number
Use NSMutableDictionary only if you are actually going to change the data, otherwise use a standard NSDictionary (this is more of style thing, the actual implementation does not really change).
If you want to cycle through the cardlist array, do the following:
That should go through all of your cardlist array and print the values.