Legacy Mac OS X Reference Library Apple Developer Connection

Getting Started with Cocoa

Technology Overview

Cocoa helps you create commercial-grade applications quickly and efficiently. It is an advanced, mature object-oriented development environment that enables you to create complex software with surprisingly few lines of code. Through a seamless integration of tools and Cocoa API, the design and construction of a user interface is largely a matter of dragging windows, buttons, and other objects from palettes, initializing their attributes, and connecting them to other objects. Cocoa also defines a model for applications and implements most aspects of application behavior; you simply fit into this model the code that makes your application unique. The programmatic interfaces of the core Cocoa frameworks, Foundation and Application Kit, simplify access to most of the technologies on which Mac OS X is based, such as Quartz, Bonjour networking, Core Text, and the printing system. Although these interfaces are in Objective-C, you can integrate code written in other languages into your Cocoa projects, including C++ code and C code. Because Objective-C is a superset of ANSI C, frameworks with C APIs are compatible with Objective-C. If you haven’t already done so, glance through the Cocoa Reference Library to get an idea of the information that is available.

Start Here

You should first have a working knowledge of the C language and you should be familiar with basic programming constructs. Then, before you write a line of code, become familiar with the Cocoa environment by reading:

If you have the time, read all of Cocoa Fundamentals Guide for an orientation to Cocoa software development, including the basic concepts, terminology, design patterns, and architectures.

To obtain the tools and other resources necessary for Cocoa programming, go to the Mac Dev Center.

Choose a Learning Path

Becoming a productive Cocoa programmer begins with becoming familiar with the languages, tools, and programming interfaces. After that, you might want to integrate an existing code base into a Cocoa application.

Learning Object-Oriented Programming

The first step toward Cocoa development is learning the concepts of object-oriented programming and Objective-C, the simple yet powerful object-oriented programming language in which Cocoa is implemented:

Learning About the Development Tools

If you want to find out what the development cycle is like and how the tools work together, start with Understanding Xcode Projects and then read A Tour of Xcode. Xcode is the name of both Apple’s integrated development environment and the application used for managing, building, and debugging projects. Also take a look at Mac OS X Technology Overview to learn more about the development tools that you use to create, build, debug, and fine-tune Cocoa programs.

If you want to know more about constructing user interfaces, read Interface Builder. The online help for the Interface Builder application also contains helpful information.

Learning About the Cocoa API

The core frameworks of Cocoa, Foundation and Application Kit, consist of hundreds of Objective-C classes and thousands of methods. To make this large API more approachable, Apple provides dozens of programming guides, overviews, and other documents. Beginning Cocoa programmers will want to read some of the following recommended documents:

Learning How to Port and Integrate Code

If you have existing code written for Carbon, UNIX, or another platform, you can often integrate much of that code base into a Cocoa application. Read the following information for guidance on porting and integrating your existing code:

Next Steps

The Cocoa Reference Library includes the following high-level resource pages, which you can bookmark for easy access:



Last updated: 2008-10-15

Did this document help you? Yes It's good, but... Not helpful...