当某个Cell被按下时触发的事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([tableView isEqual:self.myTable]) {
NSString *temp = [NSString stringWithFormat:@"Cell %ld in Section %ld is selected",(long)indexPath.section,(long)indexPath.row];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:temp message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
}
}
效果如下