Re: Swift Keypress KeyDown NSResponder input function needed.
Re: Swift Keypress KeyDown NSResponder input function needed.
- Subject: Re: Swift Keypress KeyDown NSResponder input function needed.
- From: Uli Kusterer <email@hidden>
- Date: Thu, 12 Mar 2015 17:03:42 +0100
> On 12 Mar 2015, at 16:17, Uli Kusterer <email@hidden> wrote:
>
> On 12 Mar 2015, at 01:09, Mutlu Qwerty <email@hidden> wrote:
>> self.nextResponder = super.nextResponder //insert self into the Responder chain
>
> I think you mis-typed here. super nextResponder calls the superclass's implementation of -nextResponder, but it still just calls nextResponder with self being your object. So you're setting nextResponder to the value it already has. It's a no-op.
>
> Did you perhaps mean self.superview.nextResponder?
Oh wait, you're in an NSViewController, so I don't really know what you're trying to achieve with this code ... ? You need some other object in the responder chain behind which you want to insert the view controller.
But really, since ... I think 10.8 or 10.9 or so, NSViewControllers are automatically inserted in the responder chain, so you do not need to do it yourself (and in fact, if you do it, you cause a circle in the responder chain, so don't do that).
-- Uli
http://stacksmith.org
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden