Dana Vrajitoru
B583 Game Programming and Design

Introduction to Objective C

Objective C

Class Interface

Class Implementation

Forward Class Declaration

Public - Protected - Private

Properties

Property Types

Class Methods

Calling Methods

Example

@implementation Tile;
- (void) setW: (int) width andH: (int) height
{ ... }
- init // type is (id) if not given
{ ... 
  return self;
}
main.m:
Tile *t = [[Tile alloc] init];
[t setW: 20 andH: 30];

Interface Builder

Model - View - Controller

View - Controller

Example IB MainMenu.xib

Examples IB