Most object-oriented development environments consist of at least three parts:
- A library of objects
- A set of development tools
- An object-oriented programming language and support library
Cocoa is an extensive library. It includes several software frameworks containing definitions for objects that you can use “off the shelf??? or adapt to your program’s needs. These include the Foundation framework, the Application Kit framework (for building a graphical user interface), and others.
Mac OS X also includes development tools for putting together applications. There’s Interface Builder, a program that lets you design an application graphically and assemble its user interface interactively, and Xcode, a project-management program that provides graphical access to the compiler, the debugger, documentation, a program editor, and other tools.
This document is about the third component of the development environment—the programming language and its runtime environment. All Cocoa frameworks are written in the Objective-C language. To get the benefit of the frameworks, applications must use either Objective-C or a language bridged to Objective-C, such as Java.
Objective-C is defined as set of extensions to the C language. It’s designed to give C full object-oriented programming capabilities, and to do so in a simple and straightforward way. Its additions to C are few and are mostly based on Smalltalk, one of the first object-oriented programming languages.
This document both introduces the object-oriented model that Objective-C is based upon and fully documents the language. It concentrates on the Objective-C extensions to C, not on the C language itself. There are many good books available on C; this book doesn’t attempt to duplicate them.
Because this isn’t a document about C, it assumes some prior acquaintance with that language. However, it doesn’t have to be an extensive acquaintance. Object-oriented programming in Objective-C is sufficiently different from procedural programming in standard C that you won’t be hampered if you’re not an experienced C programmer.