I've started learning IOS, I'm wondering does the viewdidload:
method get called before the view appears on screen? The apple developer guide says this method gets called after the view is loaded into memory but I don't understand What "loaded into memory" means, does it mean the view doesn't appear on screen?

- 13,151
- 9
- 53
- 80

- 101
- 1
- 1
- 3
-
possible duplicate of [iPhone: What gets called after viewDidLoad before viewWillAppear?](http://stackoverflow.com/questions/6821067/iphone-what-gets-called-after-viewdidload-before-viewwillappear) – memmons Aug 12 '14 at 18:21
-
yes, please refer view controller life cycle https://stackoverflow.com/questions/5562938/looking-to-understand-the-ios-uiviewcontroller-lifecycle – pransi_k Jul 31 '17 at 12:12
4 Answers
Does the viewdidload method get called before the view appears?
Yes.
Borrowed from this answer, view controller delegate method order is:
- (void)loadView;
- (void)viewDidLoad;
- (void)viewWillAppear;
- (void)viewDidAppear;
What "loaded into memory" means?
It means when the object (view) is created. It is possible to create and show a view virtually at the same time. However, technically viewDidLoad will be called first.

- 1
- 1

- 71,546
- 23
- 135
- 174
Yes, viewDidLoad method is called before viewDidAppear:.
viewDidLoad and viewDidLoad: mean actually different things. You specify : if it has an argument, but viewDidLoad does not, just as a convention.
Loaded in memory means ready to use/display.

- 4,236
- 4
- 27
- 42
Yes, it is called before. ViewDidAppear - it is called when the view is visible to the user, here is the place to start an animation or something like that.
More information about the view controller lifecycle: https://stackoverflow.com/a/5570363/3482000

- 1
- 1

- 9,921
- 4
- 36
- 57
Yes viewdidload: is called before viewWillAppear:. and The apple developer guide says this method gets called after the view is loaded into memory means, The viewController in storyboard/XIB is loading into device memory. Other way we can say the user interface which i design into XIB or storyboard is loding into memory...

- 1,201
- 1
- 9
- 20