Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selector for "Define" Edit Menu item in iOS 5

I'm building my own custom Edit Menu (UIMenuController) and am using the typical

-(BOOL)canPerformAction:(SEL)action withSender(id)sender

method to conditionally enable / disable system defaults. The typical edit methods are well documented (copy:, cut:, etc.), but I can't find anything about what method is called by the "Define" menu option to pull up the new word dictionary in iOS 5. Maybe it's hiding in plain sight, but I've spent hours looking for it, so I'd appreciate any help. Specifically, I need:

if (action == @selector(defineWord:)) ......

but give me what really goes in the place of "defineWord:"

ps - I wouldn't mind knowing what class the method belongs to, just out of curiosity (copy: belongs to UIResponderStandardEditActions, for example)

like image 852
Michael Avatar asked Nov 05 '11 16:11

Michael


1 Answers

By implementing this:

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
    NSLog(@"%@", NSStringFromSelector(action));
}

I was able to see that the selector is "_define:".

like image 77
Jeremy Avatar answered Sep 22 '22 23:09

Jeremy