• 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: Help with First Responder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with First Responder


  • Subject: Re: Help with First Responder
  • From: Mike Ferris <email@hidden>
  • Date: Mon, 23 Dec 2002 10:08:42 -0800

There's two things to know here...

First, in IB you can add actions to the "First Responder" class. It's not a real class, but adding methods is the same as for a "real" class in IB. Select the First Responder, go to the Classes tab, bring up the Attributes Info, and add.

Second, The NSWindowController of a window, if it has one, is the window's nextResponder. And, if the NSWindowController has an associated NSDocument, although NSDocument is not an NSResponder, it will also get a chance to handle action messages.

So, declare the method on First Responder in your main nib, wire the menu command to it, and then implement the action in your NSWindowController subclass or your NSDocument subclass.

Mike


Begin forwarded message:

From: Ted Lowery <email@hidden>
Date: Mon Dec 23, 2002 7:26:38 AM US/Pacific
To: email@hidden
Subject: Help with First Responder

Hi All-

I can't seem to understand how to make the first responder chain work. I have a menu command that I'd like to send a message to the current main (key?) window. This is easy enough with the canned messages that MainMenu's first responder respond to. But what about adding my own messages? I have a method in the controller for my document that I can call from a button on the window, but there doesn't seem to be a way to connect the menu to the document's nib.

Help?

Thanks, Ted
_______________________________________________
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.
_______________________________________________
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.

References: 
 >Help with First Responder (From: Ted Lowery <email@hidden>)

  • Prev by Date: Re: FTP uploading with writeToURL: and NSURL ?
  • Next by Date: Re: SetLevel: window and drawers
  • Previous by thread: Re: Help with First Responder
  • Next by thread: Re: Help with First Responder
  • Index(es):
    • Date
    • Thread