在空模板中查看
我需要在空模板上使用控制器创建自己的视图,而无需界面生成器的帮助。我需要在 AppDelegate 中写什么?
I need to create my own view with controller on empty template without help of Interface Builder. What i need to write in AppDelegate ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
XCode->新项目->选择基于窗口的模板。然后从资源中删除 MainWindow.xib,从 info.plist 中删除此键“Main Nib file base name”。在您的 main.m 文件中
int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate"); // 第四个参数是您的 AppDelegate 的名称。在您的 AppDelegate.h 中删除 IBOutlet UIWindow 的属性/合成,因为您根本不使用 IB。
XCode -> New project -> Select Window Based Template. Then Remove MainWindow.xib from resources, from info.plist remove this key "Main Nib file base name".In your main.m file
int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate"); // 4th parameter is name of your AppDelegate. In your AppDelegate.h remove property/synthesize for your IBOutlet UIWindow as you are not using IB at all..