Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 2, 2009, 01:27 PM   #1
carterx
macrumors member
 
Join Date: Dec 2006
What is the difference between Cocoa & Xcode?

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.
carterx is offline   0 Reply With Quote
Old Oct 2, 2009, 01:49 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
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.
kainjow is offline   0 Reply With Quote
Old Oct 2, 2009, 02:23 PM   #3
GorillaPaws
macrumors 6502a
 
GorillaPaws's Avatar
 
Join Date: Oct 2003
Location: 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.
__________________
How to ask good programming questions: Getting Answers
GorillaPaws is offline   0 Reply With Quote
Old Oct 2, 2009, 02:23 PM   #4
AJClayton
macrumors regular
 
Join Date: Jan 2007
Location: 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...
__________________
nMP 6-core/32GB/512GB/D300; ACD 30"; rMBP 13"/i5/8GB/128GB; iPhone 5s; iPad 3; Apple TV 3 (and plenty of old Apple kit in the loft)
AJClayton is offline   1 Reply With Quote
Old Oct 2, 2009, 02:56 PM   #5
Consultant
macrumors G5
 
Consultant's Avatar
 
Join Date: Jun 2007
If you can't figure that out, attempting to be a developer is probably not the best idea.
Consultant is offline   0 Reply With Quote
Old Oct 2, 2009, 03:17 PM   #6
carterx
Thread Starter
macrumors member
 
Join Date: Dec 2006
thanks for the tips everyone.
carterx is offline   0 Reply With Quote
Old Oct 2, 2009, 03:54 PM   #7
admanimal
macrumors 68040
 
Join Date: Apr 2005
Quote:
Originally Posted by GorillaPaws View Post
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.
admanimal is offline   0 Reply With Quote
Old Oct 2, 2009, 04:57 PM   #8
GorillaPaws
macrumors 6502a
 
GorillaPaws's Avatar
 
Join Date: Oct 2003
Location: Richmond, VA
Quote:
Originally Posted by admanimal View Post
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.
__________________
How to ask good programming questions: Getting Answers
GorillaPaws is offline   0 Reply With Quote
Old Oct 3, 2009, 01:00 AM   #9
electroshock
macrumors 6502a
 
electroshock's Avatar
 
Join Date: Sep 2009
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.
electroshock is offline   0 Reply With Quote
Old Oct 3, 2009, 02:19 AM   #10
admanimal
macrumors 68040
 
Join Date: Apr 2005
Quote:
Originally Posted by electroshock View Post
Language, library, editor. Cocoa being the library and Xcode being the editor and compiler.
XCode isn't a compiler, just an IDE. GCC is the compiler that XCode uses for your code.
admanimal is offline   0 Reply With Quote
Old Mar 20, 2013, 09:37 AM   #11
JamesCCook
macrumors newbie
 
Join Date: May 2012
Quote:
Originally Posted by Consultant View Post
If you can't figure that out, attempting to be a developer is probably not the best idea.
What's with the hate? Why discourage someone who asks sincerely for your help and knowledge?
JamesCCook is offline   2 Reply With Quote
Old Mar 20, 2013, 03:52 PM   #12
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Quote:
Originally Posted by admanimal View Post
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.
__________________
Don't tell me Macs don't last: 2007 iMac, 2007 Mac Mini, 2008 MacBook Air, all Vintage.
(iMac obsoletion: April 28, 2015, MBA: October 14, 2015, Mac Mini: March 9, 2016)
ArtOfWarfare is offline   0 Reply With Quote
Old Mar 20, 2013, 09:23 PM   #13
Mr. Retrofire
macrumors 601
 
Mr. Retrofire's Avatar
 
Join Date: Mar 2010
Location: www.emiliana.cl
Quote:
Originally Posted by admanimal View Post
XCode isn't a compiler, just an IDE. GCC is the compiler that XCode uses for your code.
Not in 10.9.
__________________

“Only the dead have seen the end of the war.”
-- Plato --
Mr. Retrofire is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Command line tools & Xcode 5 & Mavericks ka-spot OS X Mavericks (10.9) 1 Oct 24, 2013 10:35 AM
Xcode or cocoa? Pajamaxllama iPhone/iPad Programming 9 Oct 22, 2013 10:01 AM
Binary & Xcode americanGTA iPhone/iPad Programming 24 Aug 17, 2013 12:54 PM
XCode - Cocoa-applescript question djjasonsa Mac Programming 3 Feb 21, 2013 04:50 PM

Forum Jump

All times are GMT -5. The time now is 05:57 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC