参考文档:https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/ViewLoadingandUnloading/ViewLoadingandUnloading.html#//apple_ref/doc/uid/TP40007457-CH10-SW1
ViewController的生命周期中各方法执行流程:
init—>loadView—>viewDidLoad—>viewWillApper—>viewDidApper—>viewWillDisapper—>viewDidDisapper—>viewWillUnload->viewDidUnload—>dealloc
IOS6版本之后修改了ViewController的生命周期,取消了viewDidUnload的调用,用didReceiveMemoryWarning代替,IOS6之前viewDidUnload和didReceiveMemoryWarning都会被调用。