• 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: Making a delegate NSResponder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making a delegate NSResponder


  • Subject: Re: Making a delegate NSResponder
  • From: Dustin Voss <email@hidden>
  • Date: Sun, 28 Dec 2003 14:06:23 -0800

I made a sub-class of NSWindow called ResponderNotificationWindow. I override makeFirstResponder: to call the super's implementation, then it calls the window delegate's windowDidMakeFirstResponder: method, and posts the corresponding notification.

So the responder chain ought to be complete. So why isn't my NSView class picking up the action? Grrr.

On 23 Dec, 2003, at 8:59 AM, Fritz Anderson wrote:

I can't seem to find "windowDidMakeFirstResponder:" in any API or reference I have handy. By any chance is it private? There may be a reason it is private, namely that at the time it is called, the responder chain may not be not complete.

This ain't Windows. The unpublished APIs aren't hidden gold.

-- F

On 22 Dec 2003, at 3:40 PM, Dustin Voss wrote:
I'm expecting the DelegatingView class to handle an action I wrote called "noteFirstResponder:" which I send to the first responder when it changes. I send it from the window controller's windowDidMakeFirstResponder: method like so:
[NSApp sendAction:@selector(noteFirstResponder:) to:nil from:nil]
...
In my tests, the first responder is a checkbox within a DelegatingView. I make the checkbox the first responder by tabbing to it. The checkbox gets a focus ring, and windowDidMakeFirstResponder: is called, so the checkbox should be the first responder and should get the "noteFirstResponder:" action.

However, I can't trace execution past the sendAction:to:from: call. I put breakpoints on the DelegatingView's tryToPerform:with: and doCommandBySelector: methods, but they never get hit. This would seem to mean that the DelegatingView is not actually part of the responder chain, or else noteFirstResponder: does not get passed along the responder chain, both of which seem very unlikely.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Making a delegate NSResponder
      • From: "Louis C. Sacha" <email@hidden>
References: 
 >Making a delegate NSResponder (From: Dustin Voss <email@hidden>)
 >Re: Making a delegate NSResponder (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: genstrings not working
  • Next by Date: Re: Weird behavior when setting the size of a window used as a sheet
  • Previous by thread: Re: Making a delegate NSResponder
  • Next by thread: Re: Making a delegate NSResponder
  • Index(es):
    • Date
    • Thread