我的应用程序中有多个故事板。我想在打开新故事板时传递一个对象。
我正在这样做:
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"SetupStoryboard" bundle:[NSBundle mainBundle]];
UINavigationController* initialHelpView = [storyboard instantiateInitialViewController];
SetupViewController *setup = (SetupViewController*) [initialHelpView topViewController];
setup.data = self.data;
initialHelpView.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:initialHelpView animated:YES completion:nil];
但是当故事板出现setup.data
时nil
,viewDidLoad
...viewWillAppear
SetupViewController
这是为什么?