Developer Tools and Technologies
The Cocoa and Cocoa Touch frameworks that power Mac OS X and iPhone OS are tightly integrated into the Xcode development experience. Cocoa's high-level APIs make it easy to add animation, networking, and the native platform appearance and behavior to your application with only a few lines of code.
Cocoa & Cocoa Touch Frameworks
The Cocoa frameworks consist of libraries, APIs, and runtimes that form the development layer for all of Mac OS X. By developing with Cocoa, you will be creating applications the same way Mac OS X itself is created. Your application will automatically inherit the great behaviors and appearances of Mac OS X, with full access to the underlying power of the UNIX operating system. Using Cocoa with the Xcode IDE is simply the best way to create native Mac applications.
For iPhone OS, the Cocoa Touch frameworks provide a similar set of functionality, tuned for the touch-based, mobile experience on iPhone.
Objective-C Gives Cocoa Its Flexibility
Much of Cocoa is implemented in Objective-C, an object-oriented programming language that uses a truly dynamic runtime to execute application events.
As your application runs, the Objective-C runtime instantiates objects based on executing logic—not just in ways defined during compilation. For example, a running Objective-C application can load an interface (a nib file created by Interface Builder), connect the Cocoa objects in the interface to your application code, then run the correct method once the UI button is pressed. No recompiling is necessary.
Because Objective-C is a superset of C, it is easy to mix C and even C++ into your Cocoa applications.
Objective-C’s dynamic runtime is similar to many modern scripting languages, making it easy to map Cocoa’s features to other languages using the Cocoa Bridge. With the Cocoa Bridge, developers can create first-class Mac OS X applications using AppleScript, Ruby, and Python.
Cocoa Uses the Model-View-Controller Design Pattern
Cocoa uses the Model-View-Controller (MVC) design pattern throughout. Models encapsulate application data, Views display and edit that data, and Controllers mediate the logic between the two. By separating responsibilities in this manner, you end up with an application that is easier to design, implement, and maintain.
The MVC pattern means that Interface Builder requires no code to be written or generated while you focus exclusively on the View of your application. Cocoa bindings on the Mac eliminate most of the glue code, making the connection between Controllers coded in Xcode and the Views designed within Interface Builder a simple matter of graphically “wiring” the two together. Interface Builder works with Cocoa to make localizing your application easy so you can quickly enter entirely new markets.




