Incidentally, since the 'for (... in ...)' syntax got mentioned earlier today, I'm prompted to ask whether anyone has found a guarantee in the documentation (or in the header files, for that matter) that, when the object being fast-enumerated is a NSArray, the contents are returned in array index order. I haven't found any written promises to this effect so far.

It may *seem* obvious that this should be the order of enumeration, but I hesitate to rely on it if it's not documented.

And, given that it's nearly as easy to "enumerate" a NSArray in order by iterating through its indexes, I did wonder whether the "fast" version might be intended to be the fastest possible enumeration, which might not be the index order if the internals of the object were somewhat complex.

Anyone know a definitive answer to this?


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to