Skip to main content

display UIMenuController on tab on cell



I have uitableview I want to display UIMenuController when I tab on cell such that if the content of the cell is text the menu show edit , send by mail else listen, send by mail adn hide it it if I leaved it or tab away of it, something like right click context menue





any idea how to achieve that





I did something like that







- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath

{

return YES;

}



- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender

{

return (action == @selector(copy:));

}



- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender

{

if (action == @selector(copy:))

NSLog(@"in real life, we'd now copy somehow");

}







but I need to customize the menu itself, and also implementing those thre methods doesn't show anything





Best regards


Comments

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?