我的故事板包含以下内容:
[导航控制器] – > [MainMenuVIEw] – > [的DetailsVIEw]
“MainMenu”标识符放在[MainMenuVIEw]中
我遇到的问题是屏幕显示空白.我需要做什么?
谢谢.
- (BOol)application:(UIApplication *)application dIDFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ UIStoryboard *storyboard = [UIStoryboard storyboarDWithname:@"MainStoryboard" bundle:nil]; MainMenuVIEw *rootVIEwController = [storyboard instantiateVIEwControllerWithIDentifIEr:@"MainMenu"]; return YES}解决方法 您需要先手动创建窗口,然后在其中添加rootVIEwController(之前的答案几乎是正确的):
- (BOol)application:(UIApplication *)application dIDFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ UIStoryboard *storyboard = [UIStoryboard storyboarDWithname:@"MainStoryboard" bundle:nil]; UIVIEwController *mainVIEwController = [storyboard instantiateInitialVIEwController]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootVIEwController = mainVIEwController; [self.window makeKeyAndVisible]; return YES;}总结
以上是内存溢出为你收集整理的objective-c – 以委托方式编程调用storyboard全部内容,希望文章能够帮你解决objective-c – 以委托方式编程调用storyboard所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)