Objective-C: Intro Michelle Alexander COMS E6998 2/4/2013
File Types Header Files –.h,.hpp (mixed Obj-c and C++) Class Files –.m,.mm (mixed Obj-c and C++) Property List –.plist
Header Files Class Definition Base Class Delegates implemented Private Variables Public Variables Functions
Function Declaration - (void) doSomethingWithString:(NSString *)s andInt:(int)i; Return typefunction nameVariables - (int) calcSomethingWithInt:(int) i andFloat:(float)f; + – before Function Declartion: + (void) aClassMethod; - (void) anInstanceMethod;
Class Files Init function AutoRelease Dealloc Object Counters – Alloc Dealloc – Retain Release
Class Files (cont) Function Definitions Comments – Instance Methods Class Methods (+) – Don’t need instance of class.