在 Xcode 4.3 中添加 UIViewController 子类
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10168649/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Adding a UIViewController subclass in Xcode 4.3
提问by Joey
I recently upgraded to Xcode 4.3 from 4.2 and it seems they have gotten rid of the New File option to add a UIViewController subclass. I used to be able to do the following:
我最近从 4.2 升级到 Xcode 4.3,似乎他们已经摆脱了 New File 选项来添加 UIViewController 子类。我曾经能够执行以下操作:
File => New File... => Cocoa Touch => UIViewController subclass.
文件 => 新建文件... => Cocoa Touch => UIViewController 子类。
but now the options for new file seem to have changed and I cannot find this option. Can somehow point me in the right direction?
但是现在新文件的选项似乎已经改变,我找不到这个选项。能以某种方式指出我正确的方向吗?
Thank you.
谢谢你。
回答by ThomasW
Under Xcode 7 the feature is a little different:
在 Xcode 7 下,该功能略有不同:
File => New => File… => iOS (Source) => Cocoa Touch Class=> choose "subclass of"UIViewController.
File => New => File… => iOS (Source) => Cocoa Touch Class=>选择UIViewController 的“子类”。
Edit:Updated for Xcode 7.3
编辑:针对 Xcode 7.3 更新
回答by Sanjeev
Use File->New->Objective-C Class
, select UIViewController
as class.
使用File->New->Objective-C Class
,选择UIViewController
为班级。