UITableView单击事件,相应的时间无法响应

在程序里创建了一个按钮和表,我想实现的是点击table里面的任何一行和按钮,相应的事件就会响应。我先在每行里面设置了tag:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:    (NSIndexPath *)indexPath {
static NSString *LabelCellIdentifier = @"cell";
UITableViewCell *cell;
cell = [tableView dequeueReusableCellWithIdentifier:LabelCellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault     reuseIdentifier:LabelCellIdentifier];


}

if (indexPath.row <= [_arrayMp3Link count]) {

cell.textLabel.text = [_arrayMp3Link objectAtIndex:indexPath.row];

 }


NSInteger count = 1;
for (NSInteger i = 0; i < indexPath.section; i++) {
count += [[tableView dataSource] tableView:tableView numberOfRowsInSection:i];
}
count += indexPath.row;

cell.tag = count;



return cell;

然后把事件放到每个按钮里,但是没有实现:

(IBAction)doDownload:(id)sender {

if(cell.tag==1)
{
[[UIApplication sharedApplication]openURL:[NSURL   URLWithString:@"http://www.google.com"]]; 
}

声明一个全局变量int

int rowNo;

然后在didSelectRowAtIndexPath中赋值

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {     rowNo= indexPath.row; }

选中行的index

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {     rowNo= indexPath.row; }