0
[array enumerateObjectsUsingBlock:^(NSDictionary *tool, NSUInteger idx, BOOL *stop) {
    NSLog("Idx :: %d",idx);  
}];

Will the log print indexes sequentially starting from 0 ... till end?
If YES, How is it faster than fast enumeration of kind for (obj in array)?

benka
  • 4,732
  • 35
  • 47
  • 58
TechnoGeezer
  • 197
  • 2
  • 2
  • 14
  • 3
    Did you check the documentation? It says it "starts with the first object and continues through to the last object". It's most likely just as fast as fast enumeration. – CrimsonChris Oct 16 '14 at 14:49
  • Fast enumeration puts elements of collection into on-stack C-array, thus removing the need to call anything to get next element on each iteration. Actual difference may be unnoticeable. Read more on "fast enumeration" in Xcode docs. – user3125367 Oct 17 '14 at 02:20

0 Answers0