2

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

5

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

Create a new cocoa touch class

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

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • Thanks for quick response. What is the difference between COCOA-TOUCH class and Objective-c class. Earlier i used to create Objective-c class which generated .h and .m files – user3147325 Sep 28 '14 at 13:52
  • Cocoa Touch means that it'll be linking with UIKit (i.e. iOS), so there will likely be a "`#import `" line at the top of the .h file. – Michael Dautermann Sep 28 '14 at 15:30