> On Sep 30, 2015, at 9:15 AM, Jonathan Mitchell <[email protected]> 
> wrote:
> 
> In my app i manage the responder chain on 10.8 and 10.9 to insert the 
> NSViewController into the responder chain.
> The view controllers are inserted just below the NSWindowController so that 
> designated view controllers can respond to actions coming up the chain from 
> any source.
> ie: the NSViewController for any view will NOT be the view’s next responder - 
> it will be higher up in the chain.
> 
> On 10.10 the view controller is automatically assigned to be the view’s next 
> responder.
> I want to override this behaviour to not assign the controller as the view’s 
> next responder. 
> I thought this would be trivial but once the NSView nextResponder has been 
> set to the controller the view seems reluctant to have its next responder 
> changed.
> The next responder remains set to the view controller;

Starting with 10.10, -[NSView setNextResponder:] forwards to the view 
controller, which is what you are seeing.

From the AppKit Release Notes 
<https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKitOlderNotes/#10_10ViewController>:

NSViewController automatically adds itself into the responder chain... When the 
view has a call to setNextResponder: made, the method will be forwarded to the 
view’s view controller. If you currently are already doing your own responder 
chain management, take particular care as the view.nextResponder may already be 
the NSViewController. This can cause an issue for apps that manually set the 
viewController.nextResponder = view.nextResponder, without checking to see if 
the view.nextResponder != viewController...

It sounds like in your case you may want to implement responder methods higher 
up in the chain that, when appropriate, dispatch messages to the view 
controller(s), but this of course will depend on your architecture and what 
exactly you are trying to do.

-Conrad
_______________________________________________

Cocoa-dev mailing list ([email protected])

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

This email sent to [email protected]

Reply via email to