Does fast enumeration in Objective-C guarantee the order of iteration?

前端 未结 2 843
忘掉有多难
忘掉有多难 2020-12-15 15:53

Can I expect it to go from the start of an array to the end in order? Can\'t find anything in the docs about this.

i.e. is

for (id val in array)
{
           


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 16:30

    Once again I've found the answer right after posting. My old reference didn't mention the order of iteration, but the online one did. The array is indeed iterated in order.

提交回复
热议问题