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.
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.
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.
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.
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.