I have created a custom cell and added a uibutton on it. On tap of that button, Im setting that button selected which changes button's image.
-(IBAction)btnInfoPressed:(id)sender
{
[btnInfo setSelected:YES];
}
The above method is in the custom cell class. Now when I scroll down, after some cells, some other cell's button is also selected even though I havent tapped that button.
Here is my cellforrowatindexpath method:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"CustomCell";
CustomCell *c = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (c == nil)
{
c = [[[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil] objectAtIndex:0];
}
c.selectionStyle = UITableViewCellSelectionStyleNone;
return c;
}
Any ideas what needs to be done about it?