简体   繁体   English

iOS无法从表视图控制器导航到另一个

[英]IOS can't navigate from a table view controller to another one

I have a table view controller TeamsViewController and when the user tap on a row, I want to go to TeamTableViewController , which is another table view controller, 我有一个表格视图控制器TeamsViewController ,当用户点击一行时,我想转到TeamTableViewController ,这是另一个表格视图控制器,

This is my code inside the TeamsViewController: 这是我在TeamsViewController中的代码:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{

    if([segue.identifier isEqualToString:@"Show Team Information"]){
        if ([segue.description isKindOfClass:[TeamTableViewController class]]){
            TeamTableViewController * teamTableViewController = (TeamTableViewController*) segue.destinationViewController;
            [teamTableViewController setTeam:[self.teams objectAtIndex:self.tableView.indexPathForSelectedRow.row]];
        }else{
            NSLog(@"That is why ");
        }
    }
}

Always the That is why is getting printed. 始终是That is why要打印。 Why please? 告诉我为什么? In the current situation, the TeamTableViewController is shown but with no data. 在当前情况下,显示了TeamTableViewController ,但没有数据。 I send the data through the setTeam message, which is not executed at all. 我通过setTeam消息发送数据,该消息根本没有执行。

Please check the image. 请检查图像。

在此处输入图片说明

The cell's identifier and segue's identifier are 100% correct. 小区的标识符和segue的标识符是100%正确的。

Could you help me please? 请问你能帮帮我吗?

I appreciate your time and efforts. 感谢您的辛勤工作。

Regards, 问候,

Change the segue.description to segue.destinationViewController . segue.description更改为segue.destinationViewController The description is of class NSString . 描述是NSString类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在xcode中从一个表视图控制器导航到另一个表视图控制器 - how to navigate from one table view controller to another table view controller in xcode 如何从一个视图控制器导航到另一视图控制器? - How to navigate from one view controller to another view controller? 如何在 Swift 中以编程方式从一个控制器导航到另一个视图控制器? - How to navigate from one controller to another View Controller programmatically in Swift? 无法从另一个视图控制器获取一个表视图数据 - Can't get one a table view data from another view controller 如何从另一个iOS访问一个控制器的表视图委托方法 - How can I access a table view delegate methods of one controller from another ios 如何在ios中从一个视图导航到另一个视图? - How to Navigate from one view to another view in ios? 无法使用按钮从一个视图控制器导航到另一个 - Cannot navigate from one view controller to another with button 如何使用 Swift 从一个视图控制器导航到另一个视图控制器 - How to Navigate from one View Controller to another using Swift iOS:无法导航到其他视图控制器 - iOS: Not able to navigate to another view controller 如何将一个导航到另一个导航控制器iOS - How to navigate one to another navigation controller iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM