ios - When should I use didFinishLaunchingWithOptions? -


i feel should know this, don't , confuses me.

when browsing through sample code , tutorials, see appdelegates have

@property uiwindow* window,

which @synthesized , followed

[window setrootviewcontroller:controllertobeset]

[window makekeyandvisible]

other apps not have single line of code anywhere in delegate.

i understand friendly arrow in storyboard denotes root view controller. packed appdelegates nib-based projects?

i need clarity on norms using didfinishlaunchingwithoptions delegate method , way views set up.

your understanding correct. following quote apple's docs (in "using view controllers in app"):

the main storyboard initializes app’s user interface

the main storyboard defined in app’s information property list file. if main storyboard declared in file, when app launches, ios performs following steps:

it instantiates window you. loads main storyboard , instantiates initial view controller. assigns new view controller window’s rootviewcontroller property , makes window visible on screen.

if don't use storyboard, need instantiate window, set window's root view controller, , make window visible in didfinishlaunchingwithoptions method. template if start single view project storyboards turned off.


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -