无法使用 Xcode 6 创建 iPhone xib 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27596483/
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
Can not create an iPhone xib file with Xcode 6
提问by csciXAV_12
The checkbox to create a .xib file in Xcode 6 seems to be disabled. I can not find any way to enable it again. Does anybody know if this is possible?
在 Xcode 6 中创建 .xib 文件的复选框似乎被禁用。我找不到任何方法可以再次启用它。有谁知道这是否可能?
采纳答案by Zigii Wong
FYI, you can create xib file by follow.
仅供参考,您可以按照以下步骤创建 xib 文件。


回答by Mike Akers
Make sure you didn't accidentally select the OS X Cocoa Class file type instead of iOS Cocoa Touch Class.
确保您没有意外选择 OS X Cocoa Class 文件类型而不是 iOS Cocoa Touch Class。
Incorrect:
不正确:


Correct:
正确的:


回答by Purushottam Padhya
Creating xib files in xcode 6 is,
在 xcode 6 中创建 xib 文件是,
First of all create empty project as, Go to-> File > New >Project, Then select IOS >Other > Empty then Next After that creating a xib file as, Go to->File >New> File then IOS > Cocoa Touch Class and then NEXT Then select Viewcontroller and check for the "Also create XIB file"Then Next
首先创建一个空项目as, Go to-> File > New > Project, 然后选择IOS >Other > Empty then Next 然后创建一个xib文件as, Go to->File >New> File 然后IOS > Cocoa Touch Class然后 NEXT 然后选择 Viewcontroller 并检查“Also create XIB file”然后 Next
This will create a empty project as well as xib file.
这将创建一个空项目以及 xib 文件。
回答by Jayprakash Dubey
I had encountered this problem. Below is fix for this :
我遇到过这个问题。以下是对此的修复:
- Right click on files present in
Project Navigatorsection. Select
New File.OR
Select
Filefrom list of tab present in XcodeSelect
New -> FileOR
Simply press
cmd+NChoose template for your new file as
iOSnot OS X, tvOS or watchOS.
- 右键单击
Project Navigator部分中存在的文件。 选择
New File。或者
File从 Xcode 中存在的选项卡列表中选择选择
New -> File或者
只需按下
cmd+N为您的新文件选择模板,而
iOS不是 OS X、tvOS 或 watchOS。
Select
Cocoa Touch Classand then pressNextEnter
Class nameand selectsubclassof it.Checkmark
Also create XIB file.Select device type and Language and then click Next
Click on
Createand make sure thatTargets is selected.

