相关疑难解决方法(0)

Objective-C中的快速枚举是否保证了迭代的顺序?

我能指望它从数组的开头到结尾的顺序吗?在文档中找不到任何关于此的内容.

即是

for (id val in array)
{
   NSLog(@"%@", val);
}
Run Code Online (Sandbox Code Playgroud)

总是打印出来的

for (int i = 0; i < [array count]; ++i)
{
   NSLog(@"%@", [array objectAtIndex:i]);
}
Run Code Online (Sandbox Code Playgroud)

arrays iteration objective-c fast-enumeration

34
推荐指数
1
解决办法
4234
查看次数

标签 统计

arrays ×1

fast-enumeration ×1

iteration ×1

objective-c ×1