NSDictionary Key For Value/Object?

Syed Absar picture Syed Absar · May 25, 2011 · Viewed 57.9k times · Source

Can we get the key for an object in an NSDictionary by passing a particular value or object?

Answer

jscs picture jscs · May 25, 2011

-[NSDictionary allKeysForObject:] returns an NSArray of all the keys whose objects match the passed object, where "match" is determined by isEqual:.