我已经使用 Storyboard启动了我的 iOS 5 应用程序,但是如果我想以编程方式模态呈现 View ,我该怎么做?我无法使用 initWithNibName
,因为不再有 nob 文件,而是 Storyboard。
例如这将给我一个空白的 UINavigationView 而不是我的 Interface Builder:
setupView = [[setupController alloc] initWithNibName:nil bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:setupView];
[self presentModalViewController:navigationController animated:YES];
如果我在界面生成器(在我的 Storyboard中)中使用一个按钮并使用“模态”将两个 View 与其链接起来,它会很有用,但我想以编程方式进行。
谢谢。
最佳答案
原来我想我一直在寻找 performSegueWithIdentifier
,它很有用。
关于objective-c - iOS 5 Storyboard和 Nibs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7820472/