Ios 如何在故事板中使用prepareSegue方法?
显示标题数组是下一个视图控制器中的数组。但这里我遇到了错误。我如何使用segue.destinationViewController对象将数据传递给下一个视图控制器。我可以知道它为什么被否决吗?可能是因为你可以在谷歌上找到大量的示例或教程搜索:我没有否决,但你问了一百次问题,这就是为什么。编辑了问题。请检查代码Ios 如何在故事板中使用prepareSegue方法?,ios,segue,uistoryboardsegue,Ios,Segue,Uistoryboardsegue,显示标题数组是下一个视图控制器中的数组。但这里我遇到了错误。我如何使用segue.destinationViewController对象将数据传递给下一个视图控制器。我可以知道它为什么被否决吗?可能是因为你可以在谷歌上找到大量的示例或教程搜索:我没有否决,但你问了一百次问题,这就是为什么。编辑了问题。请检查代码 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { NSIndexPath *in
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSIndexPath *indexPath = [self.myTableView indexPathForSelectedRow];
ThirdViewController *destViewController = segue.destinationViewController;
segue.destinationViewController displayTitlesArray = [[NSArray alloc]initWithObjects:@"first ",@"second",@"Third", nil ];}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSIndexPath *indexPath = [self.myTableView indexPathForSelectedRow];
ThirdViewController *destViewController = (ThirdViewController *)segue.destinationViewController;
destViewController.displayTitlesArray = [[NSArray alloc]initWithObjects:@"first ",@"second",@"Third", nil ];}