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 (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