本文介绍了如何更改"initwithNibName";在情节提要中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Xcode 4.2的情节提要中更改以下代码.
I want to change below code with storyboard with Xcode 4.2.
UIViewController * example = [[ExampleViewController alloc] initWithNibName:@"ExampleViewController" bundle:nil];
现在存在ExampleViewController.xib文件.但我想用情节提要制作.请帮我.(我的英语不好.对不起)
Now ExampleViewController.xib file exist.but I want to make it with storyboard.please help me.(I'm not good at English. Sorry)
推荐答案
UIStoryboard
班级是你的朋友:
The UIStoryboard
class is your friend:
UIStoryboard* sb = [UIStoryboard storyboardWithName:@"mystoryboard"
bundle:nil];
UIViewController* vc = [sb instantiateViewControllerWithIdentifier:@"ExampleViewController"];
这篇关于如何更改"initwithNibName";在情节提要中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!