Hi i have NSArray of id objects.
And i know object description NSString.
how can i find object and avoid array enumeration?
p.s. i don’t like to using NSDictionary, bcs it’s do code more difficult
Hi i have NSArray of id objects. And i know object description NSString. how
Share
If this is a lookup you plan to perform more often and speed is an issue, you should probably not store the objects in a NSArray but instead in a NSDictionary to begin with, where the keys are the description strings of the objects and the values are the objects themselves. You can then use
objectForKey:with the description string as argument, which is a O(1) lookup.