1. In cases where the number of objects in the collection is large, the for-in traversal is very fast, but small-scale traversal is not obvious (not yet normal for-loop fast)
2. If the array has been modified in the for In loop, either by adding, deleting, modifying the position of the array element, an exception is thrown, and the array has mutated during enumeration (<__NSArrayM:0xa4fc000> was mutated while Being enumerated.), but the enumerator can be detected.
3.Value Query Index, the face of a large number of arrays recommended enumerateObjectsWithOptions
for the use of parallel methods.
4. When traversing the dictionary type, it is recommended to use the enumerateKeysAndObjectsUsingBlock
block version of the dictionary traversal can take both key and value (Forin can only take the key and then manually fetch value)
Differences between for-in, for and enumerateobjectsusingblock traversal