UIViewController Functions Calling Hierarchy
I have been asked this question in many interviews for iPhone Developer position. I have googled it but couldnt find a开发者_运维问答 satisfactory answer. The Question is
" what is the order of calling for the UIViewController functions " Some of functions that i know are
- loadview
- viewDidLoad
- viewWillAppear
- viewDidUnload
It goes something like this:
-loadView,
-viewDidLoad,
-viewWillAppear,
-viewDidAppear,
-viewWillDisappear,
-viewDidDisappear,
-viewDidUnload
Try to put:
NSLog(@"%@::%@", [[self class] description], NSStringFromSelector(_cmd));
in every function of the above and see how things going in the log window...
精彩评论