Objective-C extends the C language with the following concepts and constructs:
Objects (instances of classes)
Inheritance and subtyping
Methods and method calls (or messages)
Declarations (extended from C to include class and protocol types)
Predefined types, constants, and variables
Compiler and preprocessor directives
The following sections will describe these aspects of Objective-C.
Objects are the compound values—data and operations—at the heart
of object-oriented programming. They are generalizations of simple
structured types found in C and many other languages. Like C structs,
objects have components—data fields—that maintain state. For example,
Book object might have fields to
specify the author and publisher. In addition, objects interact
through message passing, which provides an alternative to the function
calls of a procedural language.
Objective-C objects have these attributes:
An object type. An object whose type is
MyClass is said to be an
Data members of an object. An object has its own copies of the fields declared by its class or its ancestor classes.
Fields are also referred to as "instance variables." I prefer the term "fields" for several reasons: "instance variables" is redundant since there are no class variables, it is ambiguous since it could mean variables that are instances, just "variables" would be more ambiguous, and "fields" is shorter. (An alternative term is ...