profile for monkeydom at Stack Overflow, Q&A for professional and enthusiast programmers

cocoa-dom

coding bits I use, come across, like, hate, the whole shebang.

twitter | github | mastodon     rant-dom     rss | archive

Permalink
Home

+initialize

When implementing a Cocoa Classes +initialize method, don’t forget to check if you are you, otherwise you might get called twice!

@implementation MyCustomClass
+ (void)initialize {
  if (self == [MyCustomClass class]) {
    // do your stuff here!
  }
}