2

Do

for (id object in array) {
    // do something with object
}

guarantee to return the objects in the order they are put in the array?

Abhinav
  • 37,684
  • 43
  • 191
  • 309

1 Answers1

9

It's just shorthand for an enumerator. So yes for NSArrays, no for NSSets and NSDictionarys

Abizern
  • 146,289
  • 39
  • 203
  • 257
  • 6
    But thats only because NSSets and NSDictionaries are hash tables and thus are by design unordered. – JustSid Jun 02 '11 at 19:27