This is expected behavior; from the docs:

The runtime sends initialize to each class in a program exactly one
time just before the class, or any class that inherits from it, is
sent its first message from within the program. (Thus the method may
never be invoked if the class is not used.) The runtime sends the
initialize message to classes in a thread-safe manner. Superclasses
receive this message before their subclasses.

...

If a particular class does not implement initialize, the initialize
method of its superclass is invoked twice, once for the superclass and
once for the non-implementing subclass. If you want to make sure that
your class performs class-specific initializations only once,
implement initialize as in the following example:

@implementation MyClass
+ (void)initialize
{
    if ( self == [MyClass class] ) {
        /* put initialization code here */
    }
}
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to