cell单选

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

OpenShopsTypeCell *cell = [tableView cellForRowAtIndexPath:indexPath];
NSString *title = _typeTitles[indexPath.row];
if (_delegate && [_delegate respondsToSelector:@selector(selectedShopType:)]) {
    [_delegate selectedShopType:title];
}
cell.button.selected=YES;

}
-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath{
OpenShopsTypeCell *cell = [tableView cellForRowAtIndexPath:indexPath];
cell.button.selected=NO;

}

你可能感兴趣的:(cell单选)