ios - 在 appDelegate 中访问 Storyboard 和嵌套的 UIViewController

标签 ios objective-c xcode5 uistoryboard

如何访问 Storyboard以及 appDelegate 内的 UIViewControllers。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    return YES;
}

最佳答案

试试这个:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *uvc = [storyboard instantiateViewControllerWithIdentifier:@"Details"];
[self.window.rootViewController presentViewController:uvc animated:YES completion:nil];

关于ios - 在 appDelegate 中访问 Storyboard 和嵌套的 UIViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21557173/

相关文章:

ios - 如何获取 CIFilter 的显示名称?

ios - 在真实 iOS 设备上模拟虚假位置

ios - 应用程序内部的 Youtube 视频播放器(在 webview 本身内部播放)

ios - 获取 sharedApplication' 在我的苹果 watch 应用程序中不可用

iOS7 Xcode 5 升级导致长按崩溃应用程序

iphone - 如何将带有 iOS base SDK 6.1 的项目部署到带有 iOS 7 的设备

ios - NSMutablearray 删除对象也删除其他 NSMutablearray 中的对象

ios - 类扩展中声明的变量和实现类中的变量有什么区别

iphone - 在 iphone 应用程序 View 中最好在标签中显示 url 链接

xcode - Xcode 6 和 Xcode 5 可以在同一台计算机上共存吗?