What is the difference between the two methods didFinishLaunchingWithOption
and viewDidLoad
?
The former is a method of AppDlegate.m
and the latter is a method of ViewController.m
, but both of them perform the same mission of loading the UIs onto the view.
The
application:didFinishLaunchingWithOptions:
is aUIApplicationDelegate
protocol method that gets called when iOS has finished setting up an area for your App to run and is the insertion point for you, the developer, to load a view controller, etc.The
viewDidLoad
method on the other hand is a method of theUIViewController
class that gets called when an instance ofUIViewController
gets its view loaded into memory. From Apple's documentation: