Introduction to The Objective-C Programming Language 1.0
Introduces object-oriented programming and describes version 1 of the main programming language used for Cocoa development.
Who Should Read This Document
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 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.
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.
Organization of This Document
This document is divided into four chapters and two appendixes. The chapters are:
The Language describes the basic concepts and syntax of Objective-C. It covers many of the same topics as Object-Oriented Programming , but looks at them from the standpoint of the Objective-C language. It reintroduces the terminology of object-oriented programming, but in the context of Objective-C.
The Runtime System looks at the NSObject class and how Objective-C programs interact with the runtime system. In particular, it examines the paradigms for managing object allocations, dynamically loading new classes at runtime, and forwarding messages to other objects.
The appendixes contain reference material that might be useful for understanding the language. They are:
Language Summary lists and briefly comments on all of the Objective-C extensions to the C language.
Grammar presents, without comment, a formal grammar of the Objective-C extensions to the C language. This reference manual is meant to be read as a companion to the reference manual for C presented in The C Programming Language by Brian W. Kernighan and Dennis M. Ritchie, published by Prentice Hall.
Conventions
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.
See Also
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.
Next
Copyright © 2008 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2008-06-09