Key Binding action methods not declared in public headers
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