performSegueWithIdentifier在OS X中打开一个新窗口

时间:2015-08-13 19:41:12

标签: macos storyboard

我正在使用Storyboard处理OS X应用程序。

我有2个视图控制器LaunchViewController和MainViewController。 WindowController将LaunchViewController作为窗口内容。 LaunchViewController执行一些检查,然后切换到MainViewController。我希望在第一个Window中显示MainViewController,但我看到2个窗口,一个显示LaunchViewController,另一个显示使用MainViewController。

[self performSegueWithIdentifier:kSegueToContentView sender:self];

这是预期的行为吗?我应该使用ContainerView而不是调用performSegue吗?

1 个答案:

答案 0 :(得分:1)

我建议使用自定义segue以避免在新窗口中打开新的视图控制器。

This Code example可以帮助你...