• 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
Key Binding action methods not declared in public headers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Key Binding action methods not declared in public headers


  • Subject: Key Binding action methods not declared in public headers
  • From: Ross Carter <email@hidden>
  • Date: Thu, 07 Aug 2008 17:51:16 -0400

The StandardKeyBinding plist binds named action methods to numerous key combinations. Many of those action methods are declared in NSResponder.h. Many others are not found in AppKit. For example, moveToEndOfDocument: (command-down) is an NSResponder method, but moveToEndOfDocumentAndModifySelection: (shift-command-down) is not declared in any public header that I have found.

That means it’s easy to do this:
- (void) moveToEndOfDocument:(id)sender {
	// do some necessary things
	[super moveToEndOfDocument:sender];
	// do other necessary things
}

But what is the prudent way to do the equivalent for moveToEndOfDocumentAndModifySelection: ?

I am mighty tempted to use performSelector:@selector(moveToEndOfDocumentAndModifySelection:); after all, the action method is right there in StandardKeyBinding.plist for all the world to see. On the other hand, it is not in a public header and when the roll is called up yonder I don’t want to confess that I have used private methods. I suppose it will be no use arguing that it wasn’t fair for OS X to publicize those methods, bind keystrokes to them, and then implement them in a private API.

Thanks,

Ross_______________________________________________

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


  • Follow-Ups:
    • Re: Key Binding action methods not declared in public headers
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Strange flipping bug in Core Animation?
  • Next by Date: how to have a pop up menu from an ordinary button?
  • Previous by thread: NSTypesetter setLineFragmentRect:
  • Next by thread: Re: Key Binding action methods not declared in public headers
  • Index(es):
    • Date
    • Thread