• 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: Two controllers in a window, how do I get one to run a function in another?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two controllers in a window, how do I get one to run a function in another?


  • Subject: Re: Two controllers in a window, how do I get one to run a function in another?
  • From: Graham Cox <email@hidden>
  • Date: Fri, 28 Aug 2009 00:04:02 +1000


On 27/08/2009, at 11:55 PM, Support wrote:

I want to have two NSObjects (controllers) - one for the tableview and all the actions that it needs to perform, and one for the web view. I am having difficulty getting the tableview controller to tell the webview controller to display a particular page. And I can't find anything about this subject in my Cocoa books or on the web. Am I barking up the wrong tree here? Should I only have one controller per window?

I'd be most grateful for any enlightenment.


One controller for each view sounds like a good plan. There's certainly no requirement that you can have only one controller per window.

It's up to you how your controllers communicate. For example, your Webview controller could have a method "showURL:" which accepts a NSURL object, and the first controller can turn the selection into one and pass it to the second. That's all there is to it pretty much. You could probably make it nice and complicated and involve bindings and so on, but why bother? K.I.S.S...

--Graham




_______________________________________________

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: Two controllers in a window, how do I get one to run a function in another?
      • From: BareFeet <email@hidden>
    • Re: Two controllers in a window, how do I get one to run a function in another?
      • From: Sherm Pendley <email@hidden>
References: 
 >Two controllers in a window, how do I get one to run a function in another? (From: Support <email@hidden>)

  • Prev by Date: Two controllers in a window, how do I get one to run a function in another?
  • Next by Date: Best way to determine what ip address are assigned to a given network interface.
  • Previous by thread: Two controllers in a window, how do I get one to run a function in another?
  • Next by thread: Re: Two controllers in a window, how do I get one to run a function in another?
  • Index(es):
    • Date
    • Thread