title: Custom Cell Button tag always return zero
body: <p>I am in trouble with an issue for a couple of days now . The issue is i have a table with multiple custom table cell and each cell has multiple buttons . But i am always getting the tags value as zero. Below is my code</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      CuatomCell_Contacts *cell    =   (CuatomCell_Contacts *) [tableView dequeueReusableCellWithIdentifier:@"cellA"];
      if  (cell == nil)
      {
          NSArray *topLevelObjects            =   [[NSBundle mainBundle] loadNibNamed:@"CuatomCell_Contacts" owner:Nil options:nil];
  
          for (id currentObject in topLevelObjects)
          {
              if  ([currentObject isKindOfClass:[UITableViewCell class]])
              {
                  cell =  (CuatomCell_Contacts *) currentObject;
  
                  break;
              }
          }
      }
      cell.selectionStyle=UITableViewCellSelectionStyleNone;
      cell.accessoryType = UITableViewCellAccessoryNone;
      IstructContacts *ObjIstructContacts = nil;
      if (table == self.searchDisplayController.searchResultsTableView)
      {
          ObjIstructContacts = [self.filteredListContent objectAtIndex:indexPath.row];
      }
      else
      {
          ObjIstructContacts = [self.sectionedListContent objectAtIndexPath:indexPath];
      }
  
      cell.m_CtrlLblName.text = ObjIstructContacts.m_strName;
      //cell.m_CtrlLblContact_Id.text=ObjIstructContacts.m_strContact_Id;
      NSLog(@"%@",ObjIstructContacts.m_strImageUrl);
      if ([ObjIstructContacts.m_strImageUrl isEqualToString:@"No_image"])
      {
          cell.m_CtrlImgImage.image=[UIImage imageNamed:@"Person_Dumy.jpeg"];
      }
      else
      {
          NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: ObjIstructContacts.m_strImageUrl]];
  
          cell.m_CtrlImgImage.image=[UIImage imageWithData: imageData];
      }
      cell.M_CtrlBtnChat.tag=indexPath.row;
      [cell.M_CtrlBtnChat addTarget:self action:@selector(MoveToNextView:) forControlEvents:UIControlEventTouchUpInside];
      UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
      [button addTarget:self
                 action:@selector(MoveToNextView:)
       forControlEvents:UIControlEventTouchDown];
      [button setTitle:@"Custom Action" forState:UIControlStateNormal];
      button.frame = CGRectMake(150.0f, 5.0f, 150.0f, 30.0f);
      button.tag=indexPath.row;
      [cell.contentView addSubview:button];
  
      return cell;
  }
  
  
  
  -(void)MoveToNextView:(id)sender
  {
      UIButton *button = (UIButton *)sender;
  
      NSLog(@"Tag Value = %d",button.tag);
  }
  </code></pre>
  
  <p>Tag value always returns Zero .. In both static and dynamic button actions.</p>