Re: app delegate +initialize
Re: app delegate +initialize
- Subject: Re: app delegate +initialize
- From: Jens Alfke <email@hidden>
- Date: Wed, 23 Sep 2009 08:26:58 -0700
Does your class have a subclass, which also has a +initialize method,
which doesn't call [super initialize]? That might cause this sort of
behavior, because the order in which the classes load may be
indeterministic.
In general, you cannot predict the order in which objects/classes are
initialized in a nib. Down inside AppKit there's a dictionary
enumeration going on, and the ordering is undefined; in practice, it
depends on the hashcodes of the objects, which are usually their
memory addresses, which are not predictable...
This is why it's best to do your initialization in an -awakeFromNib
method, which won't be called until all the objects have been
instantiated. (Of course the order of the -awakeFromNib calls is still
random, but in practice that isn't usually a problem.)
—Jens_______________________________________________
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