如何将没有Segue的数据传递给下一个viewController

时间:2015-10-05 13:50:39

标签: ios objective-c

我正在使用第三方SDK,它需要一个viewController。

所以,我所做的就是我打电话。

PHViewController *vc = [[PHViewController alloc] init];
[self presentViewController:vc animated:YES completion:nil];

转到viewController。

但是,我确实需要将一些数据传递给这个PHViewController。我怎么做?因为如果我有故事板,我有prepareForSegue和perFormSegueWithIdentifier函数将数据传递给下一个viewController,但在此我不知道。

1 个答案:

答案 0 :(得分:1)

没有故事板:

[6:0] HEXn

使用Storyboard:

[DestinationViewController *vc = [[DestinationViewController alloc] init];
vc.myData = toBePassedData
[self presentViewController:vc animated:YES completion:nil];

上面是Swift中的故事板,但你会理解其含义。