Re: Why would +[initialize] be called twice?
Re: Why would +[initialize] be called twice?
- Subject: Re: Why would +[initialize] be called twice?
- From: Kyle Sluder <email@hidden>
- Date: Mon, 24 Aug 2009 10:28:04 -0700
On Mon, Aug 24, 2009 at 10:19 AM, Michael A.
Crawford<email@hidden> wrote:
> Why would the class initializer be called more than once when my app starts
> up? Is this expected behavior? In case you're wondering, it is called
> twice.
Read the docs for +[NSObject initialize]:
"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:"
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/doc/uid/20000050-initialize
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden