In the process of looking at the source code, I saw that some methods used
enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop);
Then I did some operations in this method. Add the value to the array. What is the benefit of writing this way? What is its specific effect? What is the difference between it and the for loop and the for in loop?
Array query, the efficiency advantage of small query is not very obvious, it is recommended to use forin. But for a large number of arrays, it is recommended to use enumerations
Another one is to traverse the dictionary and it is recommended to use enumerations, so that you can get the key and value at one time
You can operate on the array when traversing the array.
If you use forin, it is easy to crash when operating on the array when traversing the array