Set the value of an object in a complex plist file -


I want to change the value of an object in a dictionary, however, the dictionary structure is complex;

  & lt; Dict & gt; & Lt; Key & gt; Content & lt; / Key & gt; & Lt; Array & gt; & Lt; Dict & gt; & Lt; Key & gt; Details & lt; / Key & gt; & Lt; String & gt; & Lt; / String & gt; & Lt; Key & gt; Period & lt; / Key & gt; & Lt; String & gt; & Lt; / String & gt; & Lt; Key & gt; Image & lt; / Key & gt; & Lt; String & gt; & Lt; / String & gt; & Lt; / Dict & gt; & Lt; Dict & gt; & Lt; Key & gt; Details & lt; / Key & gt; & Lt; String & gt; & Lt; / String & gt; & Lt; Key & gt; Period & lt; / Key & gt; & Lt; String & gt; & Lt; / String & gt; & Lt; Key & gt; Image & lt; / Key & gt; & Lt; String & gt; & Lt; / String & gt; & Lt; / Dict & gt; & Lt; / Array & gt; & Lt; / Dict & gt;   

I can use an element (where the plast file is called data) data form: [[[Data ObjectForcae: @ "Content"] ObjectAtIndex: selectedIndex] objectForKey: @ "description"]]

How do I set the value for this object?

You can use it:

  [[Data ObjectForreake: @ "content"] objectAtIndex: selectedIndex] setObject: @ "foo" forKey: @ "description"];   

The string foo is set to selectedIndex for this key description key < Code> content .

Comments