• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: initializer for NSTextView subclass not being invoked on Nib instantiation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: initializer for NSTextView subclass not being invoked on Nib instantiation


  • Subject: Re: initializer for NSTextView subclass not being invoked on Nib instantiation
  • From: Stuart Malin <email@hidden>
  • Date: Tue, 7 Apr 2009 22:32:30 -1000

Sure does cover it - quite specifically. Thanks for the reference -- lots of good material there that I need to absorb.

On Apr 7, 2009, at 10:24 PM, Jonathan Hess wrote:

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


References: 
 >initializer for NSTextView subclass not being invoked on Nib instantiation (From: Stuart Malin <email@hidden>)
 >Re: initializer for NSTextView subclass not being invoked on Nib instantiation (From: Jonathan Hess <email@hidden>)

  • Prev by Date: Re: initializer for NSTextView subclass not being invoked on Nib instantiation
  • Next by Date: Re: initializer for NSTextView subclass not being invoked on Nib instantiation
  • Previous by thread: Re: initializer for NSTextView subclass not being invoked on Nib instantiation
  • Next by thread: Re: initializer for NSTextView subclass not being invoked on Nib instantiation
  • Index(es):
    • Date
    • Thread