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:

  • What Is Cocoa? in Cocoa Fundamentals Guide if you want to quickly gain a basic understanding of the architecture, capabilities, frameworks, and development tools of Cocoa.

  • Cocoa Application Tutorial and Cocoa Application Tutorial Using Bindings to get an idea of what Cocoa development is like.

  • A third-party introductory book on Cocoa programming such as Cocoa Programming for Mac OS X by Aaron Hillegass (published by Addison-Wesley Professional and available through Amazon). These books not only include overviews of Cocoa, but can be valuable resources in the later stages of learning.

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 Xcode Quick Tour for Mac OS X. 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:

  • Guides > Cocoa

    Conceptual and how-to information for Cocoa.

  • Reference > Cocoa

    Focused, detailed descriptions in reference format for Cocoa.

  • Release Notes > Cocoa

    Notes containing the latest news about new or changed features in the Cocoa API.

  • Sample Code > Cocoa

    Sample applications demonstrating a wide variety of Cocoa APIs and techniques. If you have installed the developer package or the Xcode CD, you might also want to look at the example projects in /Developer/Examples/Foundation and /Developer/Examples/AppKit.

  • Technical Notes > Cocoa

    Late-breaking documents on issues related to Cocoa.

  • Technical Q&As > Cocoa

    Programming tips, code snippets, and FAQs by Apple’s support engineers.

  • Mailing Lists

    The Cocoa development mailing list (cocoa-dev) is an excellent place to discuss issues or topics with fellow Cocoa developers.



© 2004, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-10-15)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.