How to get a particular key for object in NSDictionary

No comments on How to get a particular key for object in NSDictionary

Written by

in

This is how you can get a first key for object (in case it is NSString):

NSArray *keys = [yourDic allKeysForObject:yourObject];
NSString *yourKey;
if ([keys count] > 0) 
   yourKey = keys[0];

Since you may not get a key for some objects, if it is absent.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *