Anon
Anon

Reputation: 317

Xcode 6 creating new objective C Class

Working on iOS7+8 with xcode6 and running into a weird issue...

I created the first viewController and thats fine, now I created another and I am trying to set that new viewController to a new class....

in xCode4 all I had to do was create new-->Objective C Class....but I don't see this option in xcode6. All I see is this swift stuff, but I want an objective C class!

I see I can make a new objective c file, but that doesn't really help me. I want to create both the .h and .m files.

Thanks in advance,

Upvotes: 27

Views: 28259

Answers (4)

Suraj K Thomas
Suraj K Thomas

Reputation: 5883

File → New → File... or use ⌘N.

Select Coccoa Touch Class

enter image description here

enter image description here

Upvotes: 5

Ashu
Ashu

Reputation: 3523

New File -> select source under iOS-> select cocoa touch class ->click on Next Put the class name -> click on Next-> selectddestination folder and click on create. Two file will create with. m and. h

It May helps you.

Upvotes: 0

Alan Scarpa
Alan Scarpa

Reputation: 3560

I had this same issue yesterday. The solution is simple:

1) File > New

2) Under IOS, click "Source"

3) Select "Cocoa Touch Class"

And then create your Class as you used to in Xcode 4. Now you should see your .h and .m files.

Upvotes: 13

Peter Pei Guo
Peter Pei Guo

Reputation: 7870

Create Cocoa touch file - that will generate both .h and .m, and you can choose either with or without a xib generated. Be sure to pick Objective-c as language - now it lets you pick either Objective-c or Swift.

Upvotes: 53

Related Questions