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
Post a Comment