Thursday, October 02, 2008

iPhone dev 7

There is a windows style event loop. On Mac it lives in NSApplication and on the iPhone it's in UIApplication. In AppKit.h there is a method NSApplicationMain that creates the application object, sets up an autorelease pool, loads UI from something called a "nib file" (apparently a file that contains files, maybe even directories?) and starts handling events. On iPhone the equivalent method is called UIApplicationMain.

@"test" is shorthand for creating an NSString that contains "test". In some cases empty string @"" can mean no value / default value. String literals shouldn't be used as dictionary keys? Setter methods are called setSomeVariable, but getters are just "someVariable". Typical framework usage: create subclass, override methods to implement own functionality. Cocoa uses MVC.