views:

36

answers:

2

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

  1. loadview
  2. viewDidLoad
  3. viewWillAppear
  4. viewDidUnload
+3  A: 

It goes something like this:

-loadView,
-viewDidLoad,
-viewWillAppear,
-viewDidAppear,
-viewWillDisappear,
-viewDidDisappear,
-viewDidUnload
Jacob Relkin
Is that really a hierarchy though? Isn't it the function order when a view is loaded / unloaded?
Rudiger
@Jacon Thanks Boy, this is exactly what i needed!
T. A.
Awww, question changed :(
Rudiger
@T.A. Don't forget to upvote! Thanks! :)
Jacob Relkin
@Rudiger Try to answer the question and Get rewarded by an UpVote. Its better not to find errors in the Query.
T. A.
@Jacob, I just did it Boy :) by the way u already have impressive profile with 18k points, an upvote make much difference to them :).
T. A.
@T.A I answered the question as it was written. You asked originally for a hierarchy and what you wanted was an order. I'm not complaining that you changed it, but don't blame me for not giving the answer you wanted. I even deleted my answer when you amended it
Rudiger
@RudigerOk dude, i apologize my mistake . I take my words back.
T. A.
A: 

Try to put:

 NSLog(@"%@::%@", [[self class] description], NSStringFromSelector(_cmd)); 

in every function of the above and see how things going in the log window...

ohho