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,
Creating a Class To make a new class in Xcode it is advised to make a new file separate from the other code and call the class. This can be done by making a new file. To make a new file, click on File, and then New → File. A selection screen will come up, for an iphone app, select cocoa touch and objective C class.
Creating a Custom Class Go ahead an choose “Objective-C class” and hit Next. For the class name, enter “Person.” Make it a subclass of NSObject. NSObject is the base class for all objects in Apple's developer environment. It provides basic properties and functions for memory management and allocation.
To generate the class and properties files initially: From the Xcode menu bar, choose Editor > Create NSManagedObject Subclass. Select your data model, then the appropriate entity, and choose where to save the files. Xcode places both a class and a properties file into your project.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With