initializer for NSTextView subclass not being invoked on Nib instantiation
initializer for NSTextView subclass not being invoked on Nib instantiation
- Subject: initializer for NSTextView subclass not being invoked on Nib instantiation
- From: Stuart Malin <email@hidden>
- Date: Tue, 7 Apr 2009 22:15:14 -1000
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 (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