Objective-C Programming For Dummies
Book image
Explore Book Buy On Amazon

Object-oriented programming languages enable you to declare classes, create derived classes (subclass), and send messages to the objects instantiated from a class. This is the essence of object-oriented programming and part of the object-oriented extensions that Objective-C adds to C. To ensure that everything operates smoothly, compiler directives are available that enable you to inform the compiler of your classes by using @class and #import.

Interface

#import "Superclass.h"
@interface ClassName : Superclass {
instance variable declarations;
}
method declarations
@property(attributes) instance variable declaration;
–d

Implementation

#import "ClassName.h"
@implementation ClassName
@synthesize instance variable ;
method definitions
–d

Message Syntax

[receiver message]

#import

#import "filename.h"

Guarantees that a header file will be included only once.

@class

@class ClassName;

Clues the compiler into user defined types.

About This Article

This article is from the book:

About the book author:

Neal Goldstein is a veteran programmer and trusted instructor of iOS programming topics. He is the author of all editions of iPhone Application Development For Dummies. Karl Kowalski is a programmer who specializes in security and mobile apps and author of Mac Application Development For Dummies.

This article can be found in the category: