PATH Documentation > Cocoa

PreviousNext 

The Run-Time System

The Objective-C language defers as many decisions as it can from compile time and link time to run time. Whenever possible, it does things dynamically. This means that the language requires not just a compiler, but also a run-time system to execute the compiled code. The run-time system acts as a kind of operating system for the Objective-C language; it's what makes the language work.

Objective-C programs interact with the run-time system at three distinct levels:

Because the NSObject class is at the root of all inheritance hierarchies, the methods it defines are inherited by all classes. Its methods therefore establish behaviors that are inherent to every instance and every class object. However, in a few cases, the NSObject class merely defines a framework for how something should be done; it doesn't provide all the necessary code itself.

For example, the NSObject class defines a description method that should return an NSString associated with the receiver. If you define a class of named objects, you can implement a description method to return the specific character string associated with the receiver. NSObject's version of the method can't know what that name will be, so it merely returns the class name as a default.

This chapter looks at three areas where the NSObject class provides a framework and defines conventions, but where you may need to write code to fill in the details:

Other conventions of the NSObject class are described in the NSObject class specification in the Foundation Framework reference.



PreviousNext 

© 2001 Apple Computer, Inc.





Site Map |  Search Tips |  Options |  Keywords

Contact Us | Privacy Notice
Copyright © 2000 Apple Computer, Inc. All rights reserved.
1-800-MY-APPLE