a glob of nerdishness

November 20, 2007

Objective-C 2.0 Fast Enumeration internals

written by natevw @ 8:03 pm

Although the NSFastEnumeration Protocol reference is pretty obtuse, the linked article tells all you need to know about how fast enumeration is implemented. It’s not really all that complicated — or pretty, for that matter — but it nonetheless allows for (... in ...) looping over any conforming class. All that said conforming class has to do is give out a pointer to its own internal structures when possible, or, at worst, copy a handful of pointers at a time into some pre-allocated stack space.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.