Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在故事板中使用prepareSegue方法?_Ios_Segue_Uistoryboardsegue - Fatal编程技术网

Ios 如何在故事板中使用prepareSegue方法?

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

显示标题数组是下一个视图控制器中的数组。但这里我遇到了错误。我如何使用segue.destinationViewController对象将数据传递给下一个视图控制器。

我可以知道它为什么被否决吗?可能是因为你可以在谷歌上找到大量的示例或教程搜索:我没有否决,但你问了一百次问题,这就是为什么。编辑了问题。请检查代码
- (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 ];}