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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to