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

Re: First Responder Problem [Solved]


  • Subject: Re: First Responder Problem [Solved]
  • From: Shawn Erickson <email@hidden>
  • Date: Sat, 6 Mar 2004 12:38:01 -0800

On Mar 6, 2004, at 1:17 AM, Anders Totland wrote:

Ok, this is an odd one. I have an NSView subclass (B3StructureView, as
seen in Beware of Molecules 3). The view is rigged to accept first
responder, and it does. It's rigged up to respond to cut:, copy:,
paste: and delete:, and it does, because the menu items are enabled.
What it does not do, however, is actually trigger these methods when
asked. Example:

- (void)copy:(id)sender
{
NSLog(@"something");
}

When I select the copy menu item, which is enabled, and the views first
responderness is verified, the build log shows: Nothing! I have seen
something like this before, but it solved itself. Anybody got a clue as
to what is going on?

Oh my, oh my, silly silly me. It turns out the action won't be called unless it is defined in the header of a class, yet it is discovered by the menu. Well, now we know that...

What is in your headers does NOT affect what can happen at runtime (only at compile time). So you likely fixed your issue but doing something you didn't realize you did (rebuilt, set files owner correctly in IB, got a delegate setup correctly, etc.).

-Shawn
_______________________________________________
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: 
 >First Responder Problem (From: Anders Totland <email@hidden>)
 >Re: First Responder Problem [Solved] (From: Anders Totland <email@hidden>)

  • Prev by Date: Re: NSEditor, NSEditorRegistration Protocols
  • Next by Date: Re: create new elements
  • Previous by thread: Re: First Responder Problem [Solved]
  • Next by thread: NSStream: How to recognize when it is connected
  • Index(es):
    • Date
    • Thread