I am a little confused on the following methods in both my View Controller and App delegate classes
Method in App delegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Method in ViewController:
- (void)viewDidLoad
Under what situation do I need to add code in the app delegate or ViewController methods? I believe that for switching of views, we need to include it in the app delegate method, are there any rules of thumb that we need to abide by?
Thanks!
Zhen
application:didFinishLaunchingWithOptions: should be used for setup that must occur when the application is launched, e.g.
viewDidLoad should be used for any configuration that only needs to be done for that specific view controller. In some cases the view may not get loaded, so there’s no point doing that configuration in the app delegate.
e.g