Re: NSReponder chain and controllers

2008-06-20 Thread Kyle Sluder
On Fri, Jun 20, 2008 at 11:01 AM, Robert Douglas <[EMAIL PROTECTED]> wrote: > Cool. I'll probably end up doing something more like Cathy recommended but > forwardInvocation looks very powerful and useful. I'd say that's almost an understatement. It's the core of the Cocoa implementation of the

Re: NSReponder chain and controllers

2008-06-20 Thread Robert Douglas
Cool. I'll probably end up doing something more like Cathy recommended but forwardInvocation looks very powerful and useful. Rob On 19-Jun-08, at 7:02 PM, Graham Cox wrote: Sometimes dispatching from First Responder to some other object is necessary. But there is an easy way to do it oth

Re: NSReponder chain and controllers

2008-06-19 Thread Graham Cox
Sometimes dispatching from First Responder to some other object is necessary. But there is an easy way to do it other than capturing each individual message and forwarding it - just use "invocation forwarding" which will do that automatically. http://www.cocoadev.com/index.pl?NSInvocation

Re: NSReponder chain and controllers

2008-06-19 Thread Robert Douglas
Thanks for the reminder about NSViewController. I make heavy use of the NSArrayController methods but I suppose I can move most of my code over simply by using an outlet and changing self to myArrayController. But having two controllers simply to handle menu actions still doesn't seems

Re: NSReponder chain and controllers

2008-06-19 Thread Cathy Shive
NSArrayController isn't an NSResponder, so you can't add your subclasses to the responder chain. I think the problem is that you should be using NSWindowController and NSViewControllers to handle menu actions, not NSArrayController. Those objects can be added to the responder chain so you

Re: NSReponder chain and controllers

2008-06-19 Thread Adam Knight
Add your controllers to the responder chain when appropriate and then put the IBAction methods in the relevant controllers. If you duplicate methods (like delete: or cancel:) take care as to what order you add them into the chain because the first to respond wins (though it can always send

NSReponder chain and controllers

2008-06-19 Thread Robert Douglas
My code is getting ugly so I suspect I'm doing something wrong. I'm trying to hook up menu items in my main menu to actions that I've defined in my controllers. I have a Core Data doc with a multiple master-detail view hierarchy, and for testing purposes have buttons connected to a wide