Re: Calling a class's methods from within it's +(void)initialize
Re: Calling a class's methods from within it's +(void)initialize
- Subject: Re: Calling a class's methods from within it's +(void)initialize
- From: Greg Hurrell <email@hidden>
- Date: Tue, 2 Aug 2005 15:53:55 +0200
El 02/08/2005, a las 6:11, email@hidden escribió:
Yeah, so, subject is the question - is it safe to do this?
If I understand your question correctly, yes, it's perfectly safe.
When you message a class you're really just messaging a special
instance of it. See (from memory) the objc_getMetaClass() function.
If you send a message to "self" from inside your initialize method
you're sending a message to that special instance. The Objective-C
runtime is such that there will only ever be one such instance.
Greg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden