I'm working with NSViewController to create a workflow of controllers. I'm trying to patch the controller into the responder chain so that I can implement action methods in the specific controllers and in the window controller.

I'm using the following code in an attempt to create a responder chain like this:

ButtonView -> ContainerView -> MyViewController -> WindowContentView - > Window -> WindowController -> etc...

- (void)setViewController:(TLViewController *)controller {
        if (_viewController != controller) {
                [_viewController release];
                _viewController = [controller retain];
                _viewController.controller = self;
                
                [self setActiveContentView:[_viewController view]];
                
                // Patch into the responder chain
                // This must be done after the view has a superview
[_viewController setNextResponder:[[_viewController view] nextResponder]];
                [[_viewController view] setNextResponder:_viewController];
        }
}

However, it isn't working. The view controller doesn't receive any messages so I've clearly overlooked something. I've confirmed in GDB that all the -nextResponders are set correctly; I just can't figure it out. I've also confirmed using -targetForAction:to:from: that the view controller isn't returned as the target. Implementing the methods in the window controller work and it's returned as the target as expected.

Keith Duncan
[EMAIL PROTECTED], 33software.com

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to