我的didSelectRowAtIndexPath方法未調用。我重裝表和它的裝載,並也被稱爲talbeViewdidSelectRowAtIndexPath未調用觸摸
這裏是我的tableview的所有方法的所有方法:
- (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];
}
我讀了堆了一些問題,但不能得到答案。
,如果我長觸摸比細胞細胞的顏色變化,但不叫didSelectRowAtIndexPath
爲什麼它不叫?
這裏是快:
是否已經設置的tableView委託你的viewController,'tableView.delegate =自我;' –
是的,我加入它的廈門國際銀行,這就是爲什麼我的其他方法稱爲 – Kabali
您可以檢查用戶名,你在打印的NSLog它? – Vickyexpert