FROM : Jens Alfke
DATE : Mon Mar 03 07:50:15 2008
On 2 Mar '08, at 1:44 PM, Andrew Merenbach wrote:
> You probably want to use enumerators and something like the
> following code:
That's debatable. Personally, I hate using NSEnumerator because it's
slow. (Not only does it create an autoreleased enumerator object, but
most of the standard collection enumerators copy the collections they
enumerate over.)
On the other hand, using fast enumeration via the "for...in..." syntax
in ObjC-2 is a total win. Not only is the syntax clear, but the
implementation is very efficient (faster than -objectAtIndex, much
faster than NSEnumerator.)
—Jens
DATE : Mon Mar 03 07:50:15 2008
On 2 Mar '08, at 1:44 PM, Andrew Merenbach wrote:
> You probably want to use enumerators and something like the
> following code:
That's debatable. Personally, I hate using NSEnumerator because it's
slow. (Not only does it create an autoreleased enumerator object, but
most of the standard collection enumerators copy the collections they
enumerate over.)
On the other hand, using fast enumeration via the "for...in..." syntax
in ObjC-2 is a total win. Not only is the syntax clear, but the
implementation is very efficient (faster than -objectAtIndex, much
faster than NSEnumerator.)
—Jens
| Related mails | Author | Date |
|---|---|---|
| Tom Jones | Mar 2, 21:31 | |
| Seth Willits | Mar 2, 22:39 | |
| Andrew Merenbach | Mar 2, 22:44 | |
| j o a r | Mar 2, 23:01 | |
| Johannes Huning | Mar 2, 23:02 | |
| Andrew Merenbach | Mar 2, 23:16 | |
| Chris Hanson | Mar 3, 05:45 | |
| Jens Alfke | Mar 3, 07:50 |






Cocoa mail archive

