is there an destructor equivalent to the +(void) initialize static constructor of NSObject? If not, where should things that are alloc'd in a static constructor be released? I don't see anything like +(void) dealloc in the NSObject doc.
There are no constructors or destructors in Objective-C. You need to be more clear what you're asking about. What is the problem you're trying to solve?
Usually global variables that are alloced in a +initialize method aren't released. The class object itself is never dealloced.
the init message is not a static method but an instance method.
I said initialize, not init
http://developer.apple.com/mac/libr....html#//apple_ref/doc/uid/20000050-initialize
In what cases would you use initialize and not a custom init? and why do you assume that there should be a static destructor?
/* Creating, copying, and freeing instances */
+ new;
+ free;
- free;
+ alloc;
- copy;
+ allocFromZone:(void *)zone;
- copyFromZone:(void *)zone;
- (void *)zone;
So if I alloc an object in an +initialize method I can just not worry about releasing it? and NSObject provides no way of doing so?