• 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: NSWindowContoller communication issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindowContoller communication issues


  • Subject: Re: NSWindowContoller communication issues
  • From: Yann Bizeul <email@hidden>
  • Date: Tue, 13 Sep 2005 22:23:20 +0200

I think there is more than a way to do it.
I would consider AppController as a "global" object, and perhaps make it a singleton you can access from anywhere with something like [[AppController sharedController] message].
you can also override initialization methods of your NSWindowController with something like [[NewRecordController alloc] initWithArray:myArray]
or you can use accessor to set a reference to your AppController with something like [theNewRecordControllerInstance setAppController: self] for AppController.


Yann Bizeul • yann at tynsoe.org
Cocoa Developer

Tynsoe Projects
BuddyPop • GeekTool • SSH Tunnel Manager • ...
http://projects.tynsoe.org/

Le 13 sept. 05 à 19:59, James Gifford a écrit :

Hello all,

I have what is probably a rather simple problem, but is something I haven't dealt with yet.
Here is the situation: I have a pretty typical MVC setup with my main controller "AppController" connecting to my MainMenu.nib. I've also got a secondary panel in "NewRecordPanel.nib" controlled by "NewRecordController" which is opened and closed through AppController. In NewRecordController there is a NSComboBox object, and I would like to use NewRecordController as the datasource for it. The thing is, I am maintaining the data I would like to use to populate the NSComboBox in AppController.


In other words, in AppController there is an NSArray object which contains the data I would like to use in the NSComboBox which is in NewRecordController.

So my question is this: how do I use this data from AppController in NewRecordController? Is there a way to establish communication between the two controllers? I am not currently using bindings, so a way to do this without bindings would be most helpful. However, I'll take all the help I can get in this matter.

Thanks for your help.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSWindowContoller communication issues (From: James Gifford <email@hidden>)

  • Prev by Date: Obtain available disk space?
  • Next by Date: Re: NSFileHandle thread safe ?
  • Previous by thread: NSWindowContoller communication issues
  • Next by thread: Re: NSWindowContoller communication issues
  • Index(es):
    • Date
    • Thread