将xib文件替换为App委托类中的Main.storyboard文件 [英] Replace xib file with Main.storyboard file in App delegate class

查看:154
本文介绍了将xib文件替换为App委托类中的Main.storyboard文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在项目正在使用App委托类中的MainWindow.xib作为主nib文件。它在main.m文件中有这个代码

Right now project is using MainWindow.xib in App delegate class as main nib file. It has this code in main.m file

int main(int argc, char *argv[]) {

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}

我想用Mainstoryboard替换它。我在info.plist文件中将其更改为Mainstoryboard文件基本名称,但它显示错误没有设置应用程序委托。必须指定应用程序委托类才能使用主故事板文件

I want to replace it with Mainstoryboard. I changed it in the info.plist file as Mainstoryboard file base name but it shows error that there is no app delegate set. An app delegate class must be specified to use a main storyboard file.

我应该在App委托类中使用Mainstoryboard文件进行哪些编码。

What coding i should do in App delegate class to use Mainstoryboard file.

谢谢

推荐答案

替换最后一个参数( nil ) UIApplicationMain()函数,其中包含app delegate类的名称。默认情况下,它通常是 @AppDelegate

Replace the last argument (nil) of the UIApplicationMain() function with the name of the app delegate class. It's generally @"AppDelegate" by default.

这篇关于将xib文件替换为App委托类中的Main.storyboard文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆