- (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 ];}
显示标题数组是下一个视图控制器中的数组。但是我在这里得到错误。如何使用segue.destinationViewController对象将数据传递给下一个视图控制器。
答案 0 :(得分:0)
- (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 ];}