Tuesday, 6 August 2013

didSelectRowAtIndexPath not called after first 5 cells

didSelectRowAtIndexPath not called after first 5 cells

My table is relatively simple and not radically different from many I've
done before. Yet didSelectRowAtIndexPath is only called on the first 5
cells of the table. After that, the debug statement does not appear when I
tap. I've researched this issue here and have ruled out some possibilities
that are mentioned in other questions: - the table delegates are properly
set. - a GestureRecognizer (that I've set) is not swallowing the presses.
- willSelectRowAtIndexPath is not implemented
Below is my didSelectRowAtIndexPath. Let me know what else I can provide
that can help solve this problem.
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"didSelect");
NSArray *visibleCells = [partOfSpeechTable visibleCells];
UITableViewCell *cell = [visibleCells objectAtIndex:indexPath.row];
NSNumber *checkedState = [checkedStates objectAtIndex:indexPath.row];
if ([checkedState boolValue]) {
[cell setAccessoryType:UITableViewCellAccessoryNone];
[checkedStates setObject:[NSNumber numberWithBool:NO]
atIndexedSubscript:indexPath.row];
}
else {
[cell setAccessoryType:UITableViewCellAccessoryCheckmark];
[checkedStates setObject:[NSNumber numberWithBool:YES]
atIndexedSubscript:indexPath.row];
}
[[tableView cellForRowAtIndexPath:indexPath]
setSelectionStyle:UITableViewCellSelectionStyleNone];
}
(I can comment out all the accessory stuff and it makes no difference).
Thanks for any help.

No comments:

Post a Comment