我有一个非常奇怪的问题,那就是当我第一次调用didSelectRowAtIndexPath
方法时,它不起作用。尝试调用`didSelectRowAtIndexPath`但不是第一次调用
如果我再次调用它,它会完成。当我第一次设置断点时,didSelectRowAtIndexPath
中的代码也会执行,但不会推送到下一个控制器。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
tableView.allowsSelection = NO;
ChatRoom *room = [_rooms objectAtIndex:indexPath.row];
if (!room.conv) {
room.conv = [[_im imClient] conversationForId:room.convid];
}
CDChatRoomViewController* chatRoomVC=[[CDChatRoomViewController alloc] init];
chatRoomVC.room = room;
chatRoomVC.convId = room.convid;
chatRoomVC.converSation = room.conv;
chatRoomVC.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:chatRoomVC animated:YES];
}
检查方法名称正确 – Furqan
这个问题只发生在iPhone上,当我使用模拟器来测试它,一切都OK。 – Adam
你可以请张贴一些代码! –