Object Oriented Programming and the Objective-C Programming Language 1.0
(Not Recommended)
PDF
Introduction
The Language
Objects
id
Dynamic Typing
Object Messaging
Message Syntax
The Receiver’s Instance Variables
Polymorphism
Dynamic Binding
Classes
Inheritance
The NSObject Class
Inheriting Instance Variables
Inheriting Methods
Overriding One Method With Another
Abstract Classes
Class Types
Static Typing
Type Introspection
Class Objects
Creating Instances
Customization With Class Objects
Variables and Class Objects
Initializing a Class Object
Methods of the Root Class
Class Names in Source Code
Defining a Class
The Interface
Importing the Interface
Referring to Other Classes
The Role of the Interface
The Implementation
Referring to Instance Variables
The Scope of Instance Variables
How Messaging Works
Selectors
Methods and Selectors
Method Return and Argument Types
Varying the Message at Runtime
The Target-Action Paradigm
Avoiding Messaging Errors
Hidden Arguments
Messages to self and super
An Example
Using super
Redefining self
Extending Classes
Categories—Adding Methods to Existing Classes
Adding to a Class
How Categories Are Used
Categories of the Root Class
Protocols—Declaring Interfaces for Others to Implement
When to Use Protocols
Methods for Others to Implement
Declaring Interfaces for Anonymous Objects
Non-Hierarchical Similarities
Informal Protocols
Formal Protocols
Protocol Objects
Conforming to a Protocol
Type Checking
Protocols Within Protocols
Referring to Other Protocols
Enabling Static Behaviors
Static Typing
Type Checking
Return and Argument Types
Static Typing to an Inherited Class
Getting a Method Address
Getting an Object Data Structure
Exception Handling and Thread Synchronization
Handling Exceptions
Throwing Exceptions
Processing Exceptions
Synchronizing Thread Execution
Using C++ With Objective-C
Mixing Objective-C and C++ Language Features
C++ Lexical Ambiguities and Conflicts
The Runtime System
Interacting with the Runtime System
Allocating, Initializing, and Deallocating Objects
Allocating and Initializing Objects
The Returned Object
Arguments
Coordinating Classes
The Designated Initializer
Combining Allocation and Initialization
Object Ownership
Basic Ownership
Marking Objects for Later Release
Retaining Objects
Deallocation
Forwarding
Forwarding and Multiple Inheritance
Surrogate Objects
Forwarding and Inheritance
Dynamic Loading
Remote Messaging
Distributed Objects
Language Support
Synchronous and Asynchronous Messages
Pointer Arguments
Proxies and Copies
Type Encodings
Appendix A: Language Summary
Messages
Defined Types
Preprocessor Directives
Compiler Directives
Classes
Categories
Formal Protocols
Method Declarations
Method Implementations
Naming Conventions
Appendix B: Grammar
External Declarations
Type Specifiers
Type Qualifiers
Primary Expressions
Exceptions
Synchronization
Glossary
Revision History
Index