FROM : Allan Hsu
DATE : Thu Jun 08 21:56:07 2006
The class initializer will be called for every subclass that does not
have its own initialize as well. The pattern you need to follow looks
something like this:
+ (void)initialize {
if(self != [MyClass class])
return;
(insert code here)
}
This is documented in the NSObject class documentation:
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/clm/
NSObject/initialize
-Allan
--
Allan Hsu <allan at counterpop dot net>
1E64 E20F 34D9 CBA7 1300 1457 AC37 CBBB 0E92 C779
On Jun 8, 2006, at 12:49 PM, Graham wrote:
> I have a class with a class initializer:
>
> + (void)initialize;
>
> And it getting called multiple times (which is obviously causing
> problems for me).
> How is this possible?
> The class does have several subclasses, not that that should matter.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/allan%
> 40counterpop.net
>
> This email sent to <email_removed>
DATE : Thu Jun 08 21:56:07 2006
The class initializer will be called for every subclass that does not
have its own initialize as well. The pattern you need to follow looks
something like this:
+ (void)initialize {
if(self != [MyClass class])
return;
(insert code here)
}
This is documented in the NSObject class documentation:
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/clm/
NSObject/initialize
-Allan
--
Allan Hsu <allan at counterpop dot net>
1E64 E20F 34D9 CBA7 1300 1457 AC37 CBBB 0E92 C779
On Jun 8, 2006, at 12:49 PM, Graham wrote:
> I have a class with a class initializer:
>
> + (void)initialize;
>
> And it getting called multiple times (which is obviously causing
> problems for me).
> How is this possible?
> The class does have several subclasses, not that that should matter.
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/allan%
> 40counterpop.net
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Graham | Jun 8, 21:49 | |
| Allan Hsu | Jun 8, 21:56 | |
| Graham | Jun 8, 22:24 |






Cocoa mail archive

