Jonathan Rentzsch is back with a post about the macros he uses to tame Cocoa’s enumeration idiom. Here’s the macro I’ve been using: #define foreach(object, enumerator) id mjtForeachEnumerator ## object = (enumerator); if ( [mjtForeachEnumerator ## object respondsToSelector:@selector(objectEnumerator)] ) mjtForeachEnumerator ## object = [mjtForeachEnumerator ## object objectEnumerator]; SEL mjtNextObjectSEL ## object = @selector(nextObject); IMP mjtNextObjectIMP … Continue reading Cocoa Enumeration
Copy and paste this URL into your WordPress site to embed
Copy and paste this code into your site to embed