문제

I have an issue with my UITableView.

The method "didSelectRowAtIndexPath" is not called until I stay clicked on the row for 2 seconds minimum. If I just click one time on the cell like a normal person would do to select it, nothing happens : didSelectRowAtIndexPath isn't called.

My prototype cell attributes

My Table View attributes

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CellWithSelection" forIndexPath:indexPath];

    NSDictionary *player = _objects[indexPath.row];
    cell.textLabel.attributedText = [TCUtilities defaultAttributedStringWithString:[player objectForKey:@"personalName"] AndSize:DEFAULT_SIZE AndColor:DEFAULT_TEXT_COLOR];
    cell.textLabel.textAlignment = NSTextAlignmentCenter;

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    [cell setBackgroundColor:[UIColor grayColor]];
    [cell setAccessoryType:UITableViewCellAccessoryCheckmark];
}

- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    [cell setBackgroundColor:[UIColor clearColor]];
    [cell setAccessoryType:UITableViewCellAccessoryNone];
}
도움이 되었습니까?

해결책

Fixed thanks to zbMax. I had a gesture recognizer implemented in my viewDidLoad method.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top