[英]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.