tags:

views:

40

answers:

3

Hi, everyone,

I want to ask an very basic question about the iPhone application. what does mean of the the 'Cocoa' in iPhone application? Is there are relateionship between the memory management and the Cocoa? thank you very much.

+2  A: 

Cocoa is just the code name for one of the Apple API's, originally provided on the Mac (I used to code for that on my old iMac). One of the others was Carbon.

Wikipedia has a more in-depth description that will do it far more justice than my brief snippet above.

paxdiablo
A: 

Cocoa is the Apple API, the set of technical tools (not talking about IDE here) delivered by Apple in order to develop MacOS X applications. Cocoa Touch is the iPhone application API.

When you mention Memory Management in Objective-C on Mac/iPhone, you usually mean methods and of NSObject (retain, release, autorelease, retainCount). This feature is provided by the Foundation library, which is a part of Cocoa and Cocoa Touch.

However, Objective-C is now tightly connected to Mac and iPhone development, it is not unusual to assimilate Foundation to the language.

Luzal
"cocoa touch" would be better. cocoa is for OSX, "cocoa touch" for iphone
choise
Actually, paxdiablo's right, Cocoa was for MacOS X development originally. The iPhone API is called Cocoa-Touch.
Luzal
Actually, memory management is part of Cocoa/Cocoa Touch (well, Foundation really) if you are using the retain model rather than garbage collection. -retain, -release, -autorelease are all methods of NSObject.
JeremyP
You're right, I'll edit my answer in order to make that clear. But it's common to assimilate Foundation to Objective-C.For example : this book "Programming in Objective C 2.0" is essentially about the language (it only covers Cocoa and iPhone in the latest chapters), but makes you use NSObject very early on and has a chapter on Memory Management.
Luzal
+1  A: 

Cocoa is the primary Mac OS X API. For iPhone development, a variant of this API called Cocoa Touch is used.

Apps developed for Cocoa can take advantage of a garbage collector, but this is not available in Cocoa Touch applications, where the application must ensure it manages allocation and destruction correctly.

Paul Dixon
Thank you for your reply. what is garbage control?
Questions
http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29
Paul Dixon