2012-12-12 1 views

Répondre

2

Si vous utilisez iOS 5.0 ou vous pouvez ensuite utiliser le comportement par défaut:

- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    return YES; 
} 

- (BOOL)tableView:(UITableView *)tableView canPerformAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender 
{ 
    if (action == @selector(copy:)) { 
     return YES; 
    }  
    return NO; 
} 

- (void)tableView:(UITableView *)tableView performAction:(SEL)action forRowAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender 
{ 
    if (action == @selector(copy:)) { 
     [UIPasteboard generalPasteboard].string = @"test"; 
    } 
} 
Questions connexes