Enable memory warnings in the iOS simulator to catch crash issues

Enable memory warnings in the iOS simulator to catch crash issues

One common crash issue that’s tough to catch during iOS development of UIViewControllers is the unloading and re-loading of views due to memory warnings. The viewDidUnload method ONLY gets called when a memory warning comes in, NOT as part of the regular view lifecycle. During development it’s likely you may never get a memory warning, […]

Initializing UIViewControllers

Initializing UIViewControllers

Most code samples that Apple provides for initializing a view controller look something like this: 
MyController *myController = [[MyController alloc] initWithNibName:@"MyView" bundle:nil]; This always felt like a strange pattern to me. And as Ole Begemann recently pointed out, it’s poor encapsulation. Why does the caller specify which .xib file some other controller should use? Isn’t […]