我有两个UITableViews嵌入在一个UINavigationController. 在第一个 table viewcontroller 中选择一个单元格应该触发一个 push segue 到第二个。这个segue没有被执行。
第一表VC
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// getting called as planned
if (indexPath.row == 0 && reload == YES) {
// working
[self pushedRefresh:self];
reload = NO;
return;
}
NSLog(@"past return"); // logged as planned
// NOT performing!
[self performSegueWithIdentifier:@"more" sender:[self.tableView cellForRowAtIndexPath:indexPath]];
}
我所做的/注意到的
SecondTblVC'sviewDidLoad:方法没有被调用。但是,如果我使用非推送 segue,则 VC 会正确显示。- 我尝试在 sender 参数中使用
niland以获得相同的结果。selfperformSegueWithIdentifier: - 我已将第二个视图控制器转换为
UIViewController具有相同结果的香草。 - “更多”segue被正确标记并连接为
push - 没有崩溃,只是缺乏segue。
- 我已经删除了情节提要中的整个
UINavigationController设置,并用相同的结果替换了它。 - 我没有单独的 .h/.m
UINavigationController - 表视图
delegates/data source链接按计划工作。 - 有一个
destinationViewController(从登录方法中学到的)performSegue。
如果更多代码和屏幕截图有帮助,请告诉我。
谢谢你。
编辑
这是我的cellForRowAtIndexPath实现:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"ReuseCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
cell.textLabel.text = [clubNames objectAtIndex:indexPath.row];
cell.detailTextLabel.text = [times objectAtIndex:indexPath.row];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:simpleTableIdentifier];
}
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
return cell;
}