I am loading my cells from a nib, which are subclasses of UITableViewCell
.
Each of these cells are setup with userInteraction
set to YES
(in the nib file).
When tapping on a cell, the selection of the cell isn't shown (in this case grey) unless the tap is held for a brief moment.
Even when the cell selection style is shown, lifting the finger off the cell still doesn't fire didSelectRowAtIndexPath:
.
As mentioned the only way to fire it is to hold down on the cell for about 3 seconds.
Does anyone have any idea why this might be happening? All of the delegates are set up correctly, I also use the dequeuing method of loading cells.
Thanks for any advice and pointers!
EDIT 2
Apologies, misunderstood the deselect methods. Here they are working:
2012-12-28 04:20:28.120 myApp[2022:907] willSelectRowAtIndexPath: <NSIndexPath 0x1cda0400> 2 indexes [0, 0]
2012-12-28 04:20:28.130 myApp[2022:907] didSelectRowAtIndexPath: <NSIndexPath 0x1cda0400> 2 indexes [0, 0]
2012-12-28 04:20:32.166 myApp[2022:907] willSelectRowAtIndexPath: <NSIndexPath 0x1d936630> 2 indexes [1, 0]
2012-12-28 04:20:32.168 myApp[2022:907] willDeselectRowAtIndexPath: <NSIndexPath 0x1cd24770> 2 indexes [0, 0]
2012-12-28 04:20:32.171 myApp[2022:907] didDeselectRowAtIndexPath: <NSIndexPath 0x1cd24770> 2 indexes [0, 0]
2012-12-28 04:20:32.178 myApp[2022:907] didSelectRowAtIndexPath: <NSIndexPath 0x1d936630> 2 indexes [1, 0]
tableView:cellForRowAtIndexPath:
:
if (indexPath.section == 0) {
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:@"CellID"];
if (!cell) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
cell = (CustomCell *)[nib objectAtIndex:0];
}
NSArray *data = [[self.indexedData objectForKey:kIndexedDataKey] objectAtIndex:indexPath.row];
CustomObject *dataObject = [data objectAtIndex:0];
[cell setDataObject:dataObject];
return cell;
}
Custom cell properties:
All of the subviews (of the cell) have the same properties: