ios - how to determine in applicationDidBecomeActive whether it is the initial iPhone app launch? -


how determine in how determine in uiapplicationdidbecomeactivenotification whether initial app launch?whether initial app launch?

that initial start of application, opposed subsequent didbecomeactive's due application being put in background , foreground (e.g. user goes calendar app)

in applicationdidfinishlaunching:withoptions: put this:

[[nsuserdefaults standarduserdefaults] setbool:yes forkey:@"alreadylaunched"]; [[nsuserdefaults standarduserdefaults] synchronize]; 

then, in didbecomeactive:

if ([[nsuserdefaults standarduserdefaults] boolforkey:@"alreadylaunched"]) {     // not initial launch... } else {     // initial launch... } 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -