Online Test Banks
Score higher
See Online Test Banks
Learning anything is easy
Browse Online Courses
Mobile Apps
Learning on the go
Explore Mobile Apps
Dummies Store
Shop for books and more
Start Shopping

Declaring Classes and Sending Messages in Objective-C

Part of the Objective-C Programming For Dummies Cheat Sheet

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.


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


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

Message Syntax

[receiver message]


#import "filename.h"

Guarantees that a header file will be included only once.


@class ClassName;

Clues the compiler into user defined types.

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus

Objective-C Programming For Dummies Cheat Sheet


Inside Sweepstakes

Win $500. Easy.