Setting a timer from a UITableViewCell button
<p>I want to set a Time with a <code>UIButton</code> in a <code>UITableViewCell</code>. It is working when I click one button, but when I click 2 or more buttons the timer will not stop.</p>

<pre><code>  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    tabletTextLabel.text=[appDelegate.tabletArray objectAtIndex:indexPath.row];
    noOfTabletTextLabel.text=[appDelegate.noOfTabletsArray objectAtIndex:indexPath.row];



[cellButton setImage:[appDelegate.imageArray objectAtIndex:indexPath.row] forState:UIControlStateNormal];
    [cellButton addTarget:self action:@selector(CellButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    cellButton.tag = indexPath.row;


// cell.accessoryView = cellButton;
    [cell.contentView addSubview:presTextLabel];
    [cell.contentView addSubview:tabletTextLabel];
    [cell.contentView addSubview:noOfTabletTextLabel];
    [cell.contentView addSubview:cellButton];
        return cell;
</code></pre>

<p>}</p>

<pre><code> -(void)CellButtonClick:(id)sender
    {

        UIButton *button = (UIButton *)sender;
        NSLog(@"%d", button.tag); 

        [self StartTimer];

    }



 -(void)StartTimer
    {
        timer=[NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(SetTabletAlert) userInfo:nil repeats:YES];
    }



  -(void)SetTabletAlert
    {
        UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Reminder" 
            message:@"Take Tablets" 
            delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
        [alert show];
        [alert release];
    }



 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex  
    {  
         NSString *title = [alertView buttonTitleAtIndex:buttonIndex];  

        if([title isEqualToString:@"ok"])  
        {  
            if(timer)
            {
                [timer invalidate];
                timer=nil;
            }
        }   
    }
</code></pre>
