Re: initializer for NSTextView subclass not being invoked on Nib instantiation
Re: initializer for NSTextView subclass not being invoked on Nib instantiation
- Subject: Re: initializer for NSTextView subclass not being invoked on Nib instantiation
- From: Jonathan Hess <email@hidden>
- Date: Wed, 8 Apr 2009 01:24:35 -0700
Hey Stuart -
This link should cover your questions: http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/10000051i-CH4-SW19
You're using awakeFromNib for its intended purpose.
Good Luck -
Jon Hess
On Apr 8, 2009, at 1:15 AM, Stuart Malin wrote:
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
_______________________________________________
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