Who Should Read This Document
Organization of This Document
Conventions
See Also
An object-oriented approach to application development makes programs more intuitive to design, faster to develop, more amenable to modification, and easier to understand. 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
The Objective-C language is a simple computer language designed to enable sophisticated object-oriented programming. Objective-C is defined as a small but powerful set of extensions to the standard ANSI C language . Its additions to C are mostly based on Smalltalk , one of the first object-oriented programming languages. Objective-C is designed to give C full object-oriented programming capabilities, and to do so in a simple and straightforward way.
For those who have never used object-oriented programming to create applications before, this document is designed to help you become familiar with object-oriented development. It spells out some of the implications of object-oriented design and gives you a flavor of what writing an object-oriented program is really like.
The document is intended for readers who might be interested in:
Learning about object-oriented programming
Finding out about the basis for the Cocoa application framework
Programming in Objective-C
This document introduces the object-oriented model that Objective-C is based upon.
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 ANSI C that you won’t be hampered if you’re not an experienced C programmer.
This document is divided into several chapters:
“Why Objective-C?” explains why Objective-C was chosen as the development language for the Cocoa frameworks.
“Object-Oriented Programming” discusses the rationale for object-oriented programming languages and introduces much of the terminology. It develops the ideas behind object-oriented programming techniques. Even if you’re already familiar with object-oriented programming, you are encouraged to read this chapter to gain a sense of the Objective-C perspective on object-orientation and its use of terminology.
Where this document discusses functions, methods, and other programming elements, it makes special use of computer voice and italic fonts. Computer voice denotes words or characters that are to be taken literally (typed as they appear). Italic denotes words that represent something else or can be varied. For example, the syntax:
@interface
ClassName
(
CategoryName
)
means that @interface
and the two parentheses are required, but that you can choose the class name and category name.
Where example code is shown, ellipsis points indicates the parts, often substantial parts, that have been omitted:
- (void)encodeWithCoder:(NSCoder *)coder |
{ |
[super encodeWithCoder:coder]; |
... |
} |
The conventions used in the reference appendix are described in that appendix.
The Objective-C 2.0 Programming Language describes the Objective-C programming language.
Objective-C 2.0 Runtime Reference describes the data structures and functions of the Objective-C runtime support library. Your programs can use these interfaces to interact with the Objective-C runtime system. For example, you can add classes or methods, or obtain a list of all class definitions for loaded classes.
Last updated: 2007-12-11