The methods applicationDidBecomeActive, loadView, and viewDidLoad will get called at appropriate times in an iOS app. For loadView and viewDidLoad, it looks like it is:
-(void) someMethod {
//...
[viewController loadView];
[viewController viewDidLoad];
}
Is that how they get called and what is the class that call them? (Is there source code that can show the flow of the starting of an app? A lot of times, we can only see the header files but not the source code).
If I understood well your question, you would like to know about the application lifecycle, is it true?
Well, I guess there is no source code provided by apple that can display you how it looks like.
If you want to know how happens when an application starts, I suggest to read about app-launch-sequence-ios-revisited by Oleb. It’s a very good post.
About the methods you wrote, these methods shouldn’t not called manually. It’s the framework (through the iOS) that calls them for you.
The methods
loadViewandviewDidLoadare methods that are called during theUIViewControllerlifecycle.You use (override)
loadViewwhen you cannot create a storyboard or a nib file. In this manner you can provide to yourUIViewControllera fresh view. From Apple doc:In other words:
About the
viewDidLoadmethod, this is called when a view has been set up in memory. Once done you are sure that outlets, for example, are set up and you can perform additional initializations.From Apple doc:
In other words:
Finally, about
applicationDidBecomeActivemethod (or delegate if you want), this is called to let your application know that it moved from the inactive to active state.I suggest you to read UIApplicationDelegate and UIViewController class references.
If you want to simply verify the sequence call, override the methods and put a
NSLogthere.Hope it helps.