I have a Nib with a single custom NSView subclass. That view has some controls in it, including an instance of an NSTextView (that is also subclassed). When the Nib is instantiated, the -awakeFromNib method of the MyTextView class is invoked, but neither -initWithFrame: nor - initWithFrame:textContainer: are invoked. These are the two documented initializers for a NSTextView, so I thought that one of them would be invoked.

Googling this issue has led me to discover that, for NSTextView, - initWithCoder gets called instead.

I've never run into this before -- that is, my subclassed NSView objects have their -initWithFrame: invoked (and NOT -initWithCoder). Is there something in the documentation that I can look for, for a class, that would help me know which way the Nib instantiation functionality will initialize (that is, -initWithCode versus designated initializer)?

I am doing all my initialization of the instance in the -awakeFromNib method. This seems to work fine. Just curious if there's anything I need to be aware of/careful of in this case.
_______________________________________________

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