내 didSelectRowAtIndexPath 메서드가 호출되지 않았습니다. didSelectRowAtIndexPath가 Touch에서 호출되지 않았습니다.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *s = (NSString *) [app.Glb.arrayRoomList objectAtIndex:indexPath.row];
NSString *cellIdentifire = @"CellRoomList";
CellRoomList *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifire];
if(cell == nil)
{
cell = (CellRoomList*)[[[NSBundle mainBundle] loadNibNamed:@"CellRoomList" owner:self options:nil] objectAtIndex:0];
}
cell.lblRoomName.text = s;
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [app.Glb.arrayRoomList count];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSString *userName = (NSString *) [app.Glb.arrayRoomList objectAtIndex:indexPath.row];
NSLog(@"userName :---- %@",userName);
ViewController *chatController = [[ViewController alloc] init];
chatController.chatWithUser = userName;
[self.navigationController pushViewController:chatController animated:YES];
}
내가 스택의 몇 가지 질문을 읽을 수는 있지만 답변을 얻을 수 없습니다 나는 테이블과 테이블 다시로드도
talbeView 여기
의 tableview 내 모든 방법입니다 모든 방법이라고 다시로드합니다. 나는 긴 터치가보다 셀의 색상 변경 셀하지만이라고하지 않을 경우 didSelectRowAtIndexPath
왜
및 호출되지는?
viewController, tableView.delegate = self;로 테이블 뷰 델리게이트를 설정 했습니까? –
네, XIB에 추가했습니다. 다른 방법이 – Kabali
입니다. NSLog에서 인쇄 할 때 사용자 이름을 확인할 수 있습니까? – Vickyexpert