Great example Mark…
The fast enumeration solution takes advantage of two facts: -countByEnumeratingWithState: is given a chunk of space that can hold a number of pointers.
Empirically, it looks like Cocoa provides 16 pointers worth of space.
I am assuming the 16 pointers provides the initial value of ‘len’ in the program. Can you confirm that is how this is suppose to be interpreted?
I am so use to initializations that this seems to be an initialization of data that occurs behind the scenes as a result of the method in the protocol being used or implemented.
Maybe is this the reason why you used the word “empirically” ?
Would it also be technically correct to say : The first invocation of the -countByEnumeratingWithState on MacOS intializes ‘len’ with a value of 16. This could be implementation dependent.
I hope I am not reading to much into this… but it is good example that you put forth