• 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: Proper way to load child Window/Controller?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper way to load child Window/Controller?


  • Subject: Re: Proper way to load child Window/Controller?
  • From: Timothy Klein <email@hidden>
  • Date: Tue, 10 Jul 2007 12:12:27 -0600

On 9 Jul 2007, at 3:34 PM, Jason Sallis wrote:

I'm working on my first semi-real Cocoa app and am having a problem. The
app that runs as a Status Item with a menu which loads a main window. From
that window, I want to spawn child windows. What I currently have happening
is when the user clicks a button in the main window, I call a method which
has the following code to show the Preferences window:

[ snip ]

This worked fine up until now when I need to access a table control from the
Preferences window in my PreferencesController object. Since my controller
was created outside the nib instead of being baked in, I have no outlet set
to access the table.

Is this a document-based application? I have a document-based application that has a main window, and a couple of sub-windows. In the NIB files in Interface Builder, I set my "File's Owner" to have a custom class, which is my subclass of NSWindowController*. I put outlets there, which is how my controller gets at it's window and vice versa. ( I had to override -makeWindowControllers: to create my 3 custom window controller objects in the document class. The NSDocument class has a method to let you get at its window controllers).


If I'm understanding your setup, I think something like this might work.

If your app is not document-based, it works a bit differently, and I'm fuzzy on what the procedure is right now.

Timothy Klein
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


  • Follow-Ups:
    • Re: Proper way to load child Window/Controller?
      • From: "Jason Sallis" <email@hidden>
References: 
 >Proper way to load child Window/Controller? (From: "Jason Sallis" <email@hidden>)

  • Prev by Date: Re: Cross-platform toolkit with a Cocoa backend
  • Next by Date: Re: Is there a fast NSShadow alternative?
  • Previous by thread: Proper way to load child Window/Controller?
  • Next by thread: Re: Proper way to load child Window/Controller?
  • Index(es):
    • Date
    • Thread