Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

carterx

macrumors member
Original poster
Dec 4, 2006
57
13
I'm looking to try and self teach myself the basics of Cocoa then get into some minor Mac App developing but what is the difference between Cocoa & Xcode? Should I be trying to learn the basics of Cocoa or Xcode or is it technicly the same thing.

Just looking to get my feet in the water to at least start reading up on the basics.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
In a nutshell:

Cocoa is the library of code you use to write applications. Cocoa usually refers to user interface code, such as windows and menu bars, but it also refers to code that lets you work with various data types, such as arrays.

Xcode is the tool, specifically Integrated Development Environment, that you use to write your code and turn it into an actual application.
 

GorillaPaws

macrumors 6502a
Oct 26, 2003
932
8
Richmond, VA
To put it another way, Xcode is an app that lets you write Cocoa, but Xcode also lets you write code for other frameworks, using other languages. Likewise, Cocoa doesn't have to be written with Xcode; it can be written in any text editor. However, due to many conveniences, you'll typically find most people writing Cocoa Apps using Xcode and Interface Builder.

You'll definitely want to learn Xcode and Interface Builder, but these are typically taught as you need them in most tutorials on Cocoa. When you're first starting out, you'll probably be using a text editor and the terminal. Take a look at the guides section at the top of the programming forum for some helpful references as well as doing a search for learning to program Cocoa. There's a lot of really helpful information available on this site for beginners.
 

SaxPlayer

macrumors 6502a
Jan 9, 2007
713
635
Dorset, England
In addition to the reply above that answers your query very well, just a thought on the book you may choose. I found Cocoa Programming for Mac OS X by Aaron Hillegass excellent. If you go for this, make sure it's the third edition you buy as the first two releases of this book are now seriously out of date.

Good luck with your programming! :) Drink plenty of coffee... :p
 

Consultant

macrumors G5
Jun 27, 2007
13,314
34
If you can't figure that out, attempting to be a developer is probably not the best idea.
 

admanimal

macrumors 68040
Apr 22, 2005
3,531
2
To put it another way, Xcode is an app that lets you write Cocoa, but Xcode also lets you write code for other frameworks, using other languages.

Just to mince words, you don't write Cocoa- you write Objective-C code (or possibly another language) that uses Cocoa.
 

GorillaPaws

macrumors 6502a
Oct 26, 2003
932
8
Richmond, VA
Just to mince words, you don't write Cocoa- you write Objective-C code (or possibly another language) that uses Cocoa.

You are correct, although it's pretty common to see that phrase with the implied meaning you stated. My apologies to the OP if that was a point of confusion.
 

electroshock

macrumors 6502a
Sep 7, 2009
641
0
Another way of looking at it, if it helps make it a bit more clear:

Windows:

C++ (programming language) using Microsoft Foundation Class library (provided premade functions) with the Visual C++ IDE (editing and compiling environment).

C# using .NET Framework (which includes a class library) with the Visual Studio IDE.

MacOS X:

Objective-C using Cocoa library with the Xcode IDE.

Bottom line is:

Language, library, editor. Cocoa being the library and Xcode being the editor and compiler.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,554
6,053
XCode isn't a compiler, just an IDE. GCC is the compiler that XCode uses for your code.

I realize this post is 4 years old, but because someone else revised the topic today I thought I'd just mention that the compiler that Xcode now uses is Clang.
 

Berean47

macrumors newbie
Oct 12, 2015
1
0
XCode is a methodology while cocoa is a framework; meaning xcode incorporates the use of objective c with the integration of the ide to create a method for programming os x and ios. cocoa is a framework that integrates binaries or libraries with additional functionality that you can use to create these apps with.

Like JamesCCook said... if you think so highly of yourself that you are going to discourage someone from programming then maybe 'attempting to be a developer is not the best idea' for you.
 

larswik

macrumors 68000
Sep 8, 2006
1,552
11
XCode is a methodology while cocoa is a framework; meaning xcode incorporates the use of objective c with the integration of the ide to create a method for programming os x and ios. cocoa is a framework that integrates binaries or libraries with additional functionality that you can use to create these apps with.

Like JamesCCook said... if you think so highly of yourself that you are going to discourage someone from programming then maybe 'attempting to be a developer is not the best idea' for you.
This thread is about 6 1/2 years old. If he hasn't figured it out by now, programming might not be his thing.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.