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

Wildcards in a hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost . The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local , site2.local etc, and have them all resolve to localhost , while Apache serves a different site accordingly.

CCNA4 FINAL 100/100

1. Refer to the exhibit. A network administrator is trying to configure a router to use SDM. After this configuration shown in the exhibit is applied, the SDM interface of the router is still not accessible. What is the cause of the problem? *The username and password are not configured correctly. The authentication method is not configured correctly. The HTTP timeout policy is not configured correctly. The vtys are not configured correctly. 2. Refer to the exhibit. Branch A has a non-Cisco router that is using IETF encapsulation and Branch B has a Cisco router. After the commands that are shown are entered, R1 and R2 fail to establish the PVC. The R2 LMI is Cisco, and the R1 LMI is ANSI. The LMI is successfully established at both locations. Why is the PVC failing? The PVC to R1 must be point-to-point. LMI types must match on each end of a PVC. The frame relay PVCs cannot be established between Cisco and non-Cisco routers. *The IETF parameter is missing from the frame-relay map ip 10....