Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Can't create a custom class in XCode 6

I upgraded from XCode 5 to XCode 6 and I'm a little stuck. I need to create a custom class, but I can't figure out how to do it anymore! When I create a new Objective C file, I get a pull down menu with several choices I don't understand. The "Empty File" creates an implementation file but no header. Some of the others create things like "NSObject+BlogReader.m (or .h)". Any help would be appreciated.

Edit - Nevermind. I found it under "create Cocoa Touch Class"

Edit - Nevermind that. It doesn't actually work. I still don't have an answer.

I had the same problem. My solution was under "Create Cocoa Touch Class" though, even though you said that didn't work for you. Maybe you just overlooked it too quickly? This is what I do:

Create a new file and then click "Cocoa Touch Class" (It's under Source under IOS). Then simply name your class and and subclass - for example: Class: MyCustomClass
SubClass: NSObject

This will create MyCustomClass.h and MyCustomClass.m

1 Answer

It worked after I read your answer. I must have done something wrong the first time. Thanks for the help!