如何在iOS中search时获得选定的tableviewbutton值

如何在iOS中search时获得选定的tableviewbutton值

我有一个button在tableviewcell里面,在那个button,我检索json值并存储在它,但是当我点击那个button,我得到的button值正确。 但是,当我在tableview中search,然后单击该button,我会在iOS中得到一个错误的值。

view *destViewController = segue.destinationViewController; destViewController.manid = [[man objectAtIndex:[sender tag]]objectForKey:@"mgrid"]; 

我正在使用这个来获得选定的button值

 cell.invi.text = [[self.searchResults objectAtIndex:indexPath.row]objectForKey:@"mgrid"]; cell.invi.tag = indexPath.row; 

这是我在cellForRowAtIndexPath标记。