Frage

I have this NSDictionary:

My NSDictionary

I need to find an object in champions, that has a defined value for key name (in this case the value entered by user is "Nasus") and then retrieve all key/value pairs from stats. Can You help me?

Thank You.

War es hilfreich?

Lösung

To get the object from the dictionary theOfficial for the key documentation:

NSObject *pleaseRead = [theOfficial objectForKey:documentation];

To get all objects from the dictionary aQuickGoogleSearch:

NSArray *orEvenTry = [aQuickGoogleSearch allValues];

Once you've pulled an object out of a dictionary, you can treat it as a normal object.

Foo *myFooVar = [someDictionary objectForKey:@"myKey"];

Bar *myBarVar = [myFooVar someMethodThatReturnsBar];
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top