Hello StackOverflow Community,
<plist>
<dict>
<key>Non Random Key</key>
<dict>
<key>Random Key</key>
<dict>
<key>Hello</key>
<string>Hey</string>
<key>Banana</key>
<string>Bread</string>
</dict>
</dict>
</dict>
</plist>
This is my Plist File … /this/is/the/path.plist
Now i want to get the “Hey” String from “Hello”.
Solution for Non Random Key!
But i have a random Key, also this issn´t the Solution …
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/this/is/the/path.plist"];
NSString *value;
value = [plistDict objectForKey:@"/Non Random Key/Random Key/Hello"];
// value is "Hey"
But how it works with this “Random Key”?
Thank you in Advance.
And maybe, you can explain me, how i set a random key?
Also the Example at the Top but instead “Get” i would “Set” 🙂
you can iterate over the “Non Random Key” Dictionary. this should help: NSDictionary iterate