• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Swift Keypress KeyDown NSResponder input function needed.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Swift Keypress KeyDown NSResponder input function needed. (From: Mutlu Qwerty <email@hidden>)
 >Re: Swift Keypress KeyDown NSResponder input function needed. (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: Cocoa GUI app getting slower on MacPro or MacMini when disconnecting all screens
  • Next by Date: What is the best way to get events fired on keypress for an NSTextField?
  • Previous by thread: Re: Swift Keypress KeyDown NSResponder input function needed.
  • Next by thread: NSSharedWorkspace Notification Question
  • Index(es):
    • Date
    • Thread