News for hackers. Stuff that matters.
Re:Reader-submitted Objective-C / XCode tips of 2012 by mikeash on Monday December 31, 2012 @05:26PM (#4991150)
The suggestion that "+initialize is great for registering NSURLProtocol, NSValueTransformer, and NSIncrementalStore subclasses" is, alas, off the mark. If you use +initialize for anything that needs to be registered before it gets used, you'll end up with a chicken-and-egg problem, because +initialize doesn't run until the class's first use. +initialize is great for one-time setup of class-wide data, but it doesn't work for registering classes with the system when the act of registering is the only thing that causes them to be used.

There are no comments on this comment yet.