I have an NSDictionary and I need to enumerate through the objects, but I don't need the keys. I see these two different ways:
What's better here? Is it better to stick with the higher-level API that works directly on the dictionary, or tell the API that I'm going to treat the objects like an array?
Code:
[myDictionary enumerateKeysAndObjectsUsingBlock: ^(id key, id object, BOOL *stop) {
[object doSomething];
}];
[[myDictionary allValues] enumerateObjectsUsingBlock: ^(id object, NSUInteger index, BOOL *stop) {
[object doSomething];
}];
Last edited: