XCode 不创建 .h 文件 [英] XCode not creating .h file
问题描述
我使用的是 Xcode 6.0.1
I am using Xcode 6.0.1
我创建了一个自动生成 .h 和 .m 文件的新项目.
I created a new project which automatically generated .h and .m files .
当我尝试添加一个新的 Objective-c 文件时,它只会创建 .m 文件..h 文件未生成.我尝试了所有首选项,但没有找到显示生成 .h 文件"的选项.
When i try to add a new Objective-c file, it is only creating .m file. .h file is not getting generated. I tried all preferences, nowhere i found an option which says "Generate .h file".
出于好奇,我检查了 Library/Developer/Xcode/Templates,其中只有一个文件夹存在.
Out of curiosity i checked Library/Developer/Xcode/Templates where only one folder exists.
/Users/rajeshreddy/Library/Developer/Xcode/TemplatesRajeshs-MacBook-Pro:模板 rajeshreddy$ls文件模板 cocos2d v3.xRajeshs-MacBook-Pro:模板 rajeshreddy$
/Users/rajeshreddy/Library/Developer/Xcode/Templates Rajeshs-MacBook-Pro:Templates rajeshreddy$ ls File Templates cocos2d v3.x Rajeshs-MacBook-Pro:Templates rajeshreddy$
有什么设置可以让我生成 .h 文件.
Is there any setting which i can enable to generate .h file.
推荐答案
你需要新建一个 CocoaTouch class,像这样:
You need to create a new CocoaTouch class, like this:
这应该会给你一个 .m 和一个 .h 文件.
And that should give you both a .m and a .h file.
这篇关于XCode 不创建 .h 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!