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

General Discussion

Methods and classes...what's from Cocoa vs from what's from ObjC?

Amit Bijlani I have a question. I went through the whole ObjC course and did the Crystal ball project you showed us (you did a good job I enjoyed it by the way). I downloaded all the course files because when I wanted to work on my own projects I was going to use the teachings from each lesson for each aspect of my own apps until I no longer needed the references because honestly I don't have it all down pat and committed to memory.....

THEN just as I thought I was done the week I finished WWDC comes out with Swift. In the lessons you teach "methods" "classes" and stuff like that, like how to go through the documentation to find out how to added images and Nsurl....does these methods like animationbegin, animationended are they from Cocoa or ObjC?

As you can see from my question since I'm still a newbie I don't know what is the difference between Cocoa touch classes and what comes from ObjC. I want to be able to do Swift with just Cocoa touch, but I need to be able to determine the difference.

2 Answers

Objective-C is the language you're using, and Cocoa/Cocoa Touch is the framework you're using. My understanding of it is that anything that is prefixed with 2 or more capital letters is Cocoa/Cocoa Touch (NSImage, CGRect, etc..), and anything else is Objective-C.

Personally, I've been trying out Swift for a little bit on my installation of the OS X 10.10 Developer Preview, and the concepts behind the 2 languages are very similar, but the syntax is a little different. If you learn Objective-C, Swift will be relatively easy to pick up on, and you can still use Cocoa/Cocoa Touch with Swift.

Well I know ObjC is the language, okay so NSUrl, NSBundle are all aspects of Cocoa/Cocoa touch is what you are saying? If so cool. I really want to build based off of Swift and Cocoa only so if Apple retires ObjC I don't have to worry about my apps.