• 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: -viewDidMoveToWindow without subclassing? NSViewController?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -viewDidMoveToWindow without subclassing? NSViewController?


  • Subject: Re: -viewDidMoveToWindow without subclassing? NSViewController?
  • From: Michael Ash <email@hidden>
  • Date: Thu, 16 Apr 2009 01:14:05 -0400

On Wed, Apr 15, 2009 at 10:09 PM, Jerry Krinock <email@hidden> wrote:
> I have the contentView of an NSTabViewItem controlled by an
> NSViewController.  I need to run code in there to initialize things when the
> nib is loaded, but not before the view has a -window.
>
> Putting the code in -awakeFromNib is no good because it will not yet be in a
> window if another tab is selected during nib loading.  I believe it would
> work to subclass the content view and implement -viewDidMoveToWindow, but
> that seems silly since it would be the only code in this subclass.

IMO that's a silly objection. Subclassing and adding this method is
easy, straightforward, and it works. You only need to override one
method to justify having a subclass.

Mike
_______________________________________________

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: 
 >-viewDidMoveToWindow without subclassing? NSViewController? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Apple's PredicateEditorSample returns [self init] in -awakeFromNib ?!?
  • Next by Date: Re: How to control the window by cocoa
  • Previous by thread: Re: -viewDidMoveToWindow without subclassing? NSViewController?
  • Next by thread: Setting up an auxiliary task for use with Distributed Objects
  • Index(es):
    • Date
    • Thread