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

2009-09-01 Thread BareFeet
Hi again Graham and anyone else interested, Yes, I've done that, control dragged from MyController to File's Owner and selected the_document. For simplicity, I'm just creating the_document in MyController (I've no need for MyDocument to refer to the_controller). I still get nil for

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

2009-09-01 Thread Graham Cox
On 01/09/2009, at 4:13 PM, BareFeet wrote: To try to isolate the issue, I created a Refresh button and hooked it up to a refresh method in MyController. It just calls init (as below). When the program runs and instantiates a document that I open, debugging the init call shows the_document

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

2009-09-01 Thread Chase Meadors
Define an outlet in MyController IBOutlet id documentController; Connect it to MyDocument in interface builder. Then call: [documentController fileString]; --- This is a minor annoyance when using multiple controllers, as they will probably need information from the other controllers. On

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

2009-09-01 Thread BareFeet
Hi Graham, To try to isolate the issue, I created a Refresh button and hooked it up to a refresh method in MyController. It just calls init (as below). When the program runs and instantiates a document that I open, debugging the init call shows the_document as nil. But when I click

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

2009-08-31 Thread Graham Cox
On 31/08/2009, at 11:07 AM, BareFeet wrote: Hi All, 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

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

2009-08-31 Thread BareFeet
Hi Graham and all, I also tried to use bindings, which I've made work well for linking text views, table columns, even outline view columns, to data in my model. But I can't seem to set up bindings to link an instance variable in one controller to another controller. So I guess bindings

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

2009-08-31 Thread Graham Cox
On 01/09/2009, at 12:25 PM, BareFeet wrote: ahh, now that makes sense. That's what I was missing. I was trying to add IBOutlets for instance variables but needed to instead add IBOutlets for the class (eg MyDocument). Whaaa? You're probably getting your terminology confused, but the

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

2009-08-31 Thread BareFeet
Hi Graham and all, ahh, now that makes sense. That's what I was missing. I was trying to add IBOutlets for instance variables but needed to instead add IBOutlets for the class (eg MyDocument). Whaaa? You're probably getting your terminology confused but the above makes no sense to me.

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

2009-08-31 Thread Graham Cox
On 01/09/2009, at 2:55 PM, BareFeet wrote: Doh!, no, missed that. Thanks for that. That's important - it's a forward declaration, which informs the compiler that the MyDocument* is merely a pointer, and so it doesn't need to know anything else about the class - it has all it needs to

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

2009-08-30 Thread BareFeet
Hi All, 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

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

2009-08-27 Thread Support
I'm writing an application which has one window, with an NSTableView and a WebView in it. The NSTableView will contain a list of URLs and site descriptions and the WebView will display the URL when it's clicked on in the NSTableView. So far, so simple - especially if the NSTableView and

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

2009-08-27 Thread Graham Cox
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

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

2009-08-27 Thread Sherm Pendley
On Thu, Aug 27, 2009 at 10:04 AM, Graham Coxgraham@bigpond.com wrote: 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

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

2009-08-27 Thread bryscomat
The solution I'd recommend is in Cocoa Bindings. http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.html A view controller per view is a good idea. For some more samples on that, you can look at KTUIKit. http://katidev.com/blog/ktuikit/ I'd written something