• 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
initializer for NSTextView subclass not being invoked on Nib instantiation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: initializer for NSTextView subclass not being invoked on Nib instantiation
      • From: Kyle Sluder <email@hidden>
    • Re: initializer for NSTextView subclass not being invoked on Nib instantiation
      • From: Jonathan Hess <email@hidden>
  • Prev by Date: Re: How to find whether the file directory is a valid Mac OS X App?
  • Next by Date: Re: initializer for NSTextView subclass not being invoked on Nib instantiation
  • Previous by thread: Re: How to find whether the file directory is a valid Mac OS X App?
  • Next by thread: Re: initializer for NSTextView subclass not being invoked on Nib instantiation
  • Index(es):
    • Date
    • Thread