70 likes | 301 Views
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
E N D
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 *)sandInt:(int)i; Return type function name Variables - (int) calcSomethingWithInt:(int) iandFloat:(float)f; + – before Function Declartion: + (void) aClassMethod; - (void) anInstanceMethod;
Class Files • Init function • AutoRelease • Dealloc • Object Counters • AllocDealloc • Retain Release
Class Files (cont) • Function Definitions • Comments • NSLog(@””) • Instance Methods • Class Methods (+) • Don’t need instance of class.