Cocoa FAQ

From Mac Guides

Jump to: navigation, search

Cocoa is the official API of Mac OS X and the iPhone, supported by Apple.

Contents

General

I've never programmed before. How should I start learning Cocoa?

If you are serious about learning Cocoa and have never programmed before, it is strongly advised you learn the C language first, since Objective-C is a superset of C. After you are familiar with C, Objective-C will be easier. However it is not necessary to learn C immediately.

What should I use to write Cocoa Applications?

Whatever level you are it is recommended to use Xcode. Even if you aren't using Cocoa it is strongly recommended to install Xcode for any development work, even if you don't use it as it also installs general development resources.

What book do you recommend for learning Cocoa?

The most popular book is Cocoa Programming for Mac OS X, by Aaron Hillegass. However, the book is still being updated for Leopard and is expected to be available Summer 08.

What languages can I use to write Cocoa applications?

The official native language is Objective-C. However, Leopard includes bindings for Ruby and Python.

I have a background in Java/C++/C#/etc, how hard is it to learn Objective-C?

Objective-C is an easy language. You will be able to pick it up in about a day. Developers may feel more at home using Objective-C 2.0 (new in Leopard) which uses dot notation for properties.

Is there support for C++?

Cocoa does not support C++ directly. However, you can write applications using a mixture of C++ and Objective-C, formally called Objective-C++.

Where is the language documentation?

The language documentation is available through Help>Documentation in Xcode and Apple's Objective C documentation site. Searching for <<class name>> site:apple.com on Google will get you straight to the class you want.

iPhone

What do I need to start writing iPhone applications?

Download the Apple iPhone SDK.

You will also need Leopard and an Intel Mac. An iPhone or iPod touch is not required.