Wednesday, September 9, 2009

Bill Bumgarner on +initialize

This is a must read for anyone who overrides +initialize. I'll be honest, I either didn't know about this behavior or forgot it worked this way.



4 comments:

alanquatermain said...

I'll be honest here and say that I was surprised that this needed to be restated. I always thought the dev docs were very clear on the fact that +initialize would be called once for each class in the hierarchy that hadn't been sent already.

In other words, do this:

+ (void) initialize
{
if ( self != [MyClass class] )
return;

// do work
}

Jeff LaMarche said...

The docs are clear on this, but most developers haven't done much work with initialize. I've used it, but never been bitten by this particular functionality.

I find I remember things better when they've caused me problems at least once :)

Edwin said...

scrub m65 kamagra attorney lawyer body scrub field jacket lovegra marijuana attorney injury lawyer

h4ns said...

What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.

Arsenal vs Huddersfield Town live streaming
Arsenal vs Huddersfield Town live streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Notts County vs Manchester City Live Streaming
Notts County vs Manchester City Live Streaming
Bologna vs AS Roma Live Streaming
Bologna vs AS Roma Live Streaming
Juventus vs Udinese Live Streaming
Juventus vs Udinese Live Streaming
Napoli vs Sampdoria Live Streaming
Napoli vs Sampdoria Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
AS Monaco vs Marseille Live Streaming
AS Monaco vs Marseille Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Technology News | News Today | Live Streaming TV Channels