Compiler and Preprocessor Directives
Compiler and preprocessor directives are special terms in
your program that tell the compiler to perform some Objective-C-specific
action. All compiler directives start with the character
@, and preprocessor directives start with
Class Declarations and Definitions
The following compiler directives are used to begin or conclude the declaration and definition of Objective-C classes, categories, and protocols:
Begins the declaration of a class’s or category’s fields and methods.
Begins the declaration of a protocol’s methods.
Begins the definition of a class’s methods.
Ends the declaration or definition of a class’s, category’s, or protocol’s methods.
The following compiler directives generate forward declarations, informing the compiler that a type exists:
Forward declaration of a class.
Forward declaration of a protocol.
Use forward declarations when an interface uses variables (fields or method parameters or return types) of a given type. Rather than import the header file for that type, you can simply forward reference it. For example:
center; // etc. }
This is sufficient because the declaration of
Circle does not use any details ...