Understanding the iOS view controller life cycle is important, I found this diagram which clearly describes what methods are invoked at what state.

uiviewcontroller_lifecycle