XCode not creating .h file

2019-07-15 11:03发布

问题:

I am using Xcode 6.0.1

I created a new project which automatically generated .h and .m files .

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".

Out of curiosity i checked Library/Developer/Xcode/Templates where only one folder exists.

/Users/rajeshreddy/Library/Developer/Xcode/Templates Rajeshs-MacBook-Pro:Templates rajeshreddy$ ls File Templates cocos2d v3.x Rajeshs-MacBook-Pro:Templates rajeshreddy$

Is there any setting which i can enable to generate .h file.

回答1:

You need to create a new CocoaTouch class, like this:

And that should give you both a .m and a .h file.



标签: ios xcode xcode6