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.

有帮助吗?

解决方案

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];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top