iphone - My iOS App Works Well In The Simulator, But Not In A Real Device? -


so first app making jailbroken devices.

i must it's not finished yet, believe it's habit test incomplete apps in real device every , while developing app. since app jailbroken devices, have fake sign app , that.

the thing is, app has plist 2 entries: bool "hasbeenlaunchedbefore" , string "password". app changes true hasbeenlaunchedbefore when app finished configuring, when app loads gets different view. password straightforward: stores password user.

i think plist file not getting modified when launch app in device, because well, when app has never launched before, configuration wizard. everytime close app keep getting config wizard, means hasbeenlaunchedbefore not changed true supposed be. also, passwords never match, means password doesn't modified either.

everything works fine in ios simulator, not in idevice. me bit this? permissions issue? has really, left me no words or ideas fix it. guessing put plist in /documents, have no idea of how that. if has suggestions me fix this, highly appreciate it.

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {      // override point customization after application launch. nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; if(![defaults objectforkey:@"first_launch"]){ //load first_launch nsuserdefaults. should either true or false, never (null).     [self.window addsubview:configwizard.view];     uialertview *lol = [[uialertview alloc] initwithtitle:@"never started before." message:@"the app never started before." delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil];     [lol show];     [lol release]; }else{     [self.window addsubview:tabbarcontroller.view];     uialertview *lol = [[uialertview alloc] initwithtitle:@"started before." message:@"the app started before." delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil];     [lol show];     [lol release]; }  [defaults synchronize];  // add tab bar controller's view window , display. [self.window makekeyandvisible];  return yes; 

}

that's old code using when attempted load nsuserdefaults, first_launch kept returning (null).

hmm. app's behaviour on device , in simulator different. ideas testing quite right. don't (bad, honestly))), i'm quite agree supposition problem in file permissions.

as solution can suggest use nsuserdefaults. moveover, working them in situation should easier.

update

try this:

nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; if (![defaults boolforkey:@"first_launch"]) {       // use boolforkey instead objectforkey here      [defaults setbool:yes forkey:@"first_launch"];     // change value (next time launch not first one)      [defaults synchronize];    // should synchronize if values changed       uialertview *lol = [[uialertview alloc] initwithtitle:@"never started before."             message:@"the app never started before." delegate:nil             cancelbuttontitle:@"ok" otherbuttontitles:nil];      [lol show];      [lol release]; } else {      uialertview *lol = [[uialertview alloc] initwithtitle:@"started before."             message:@"the app started before." delegate:nil             cancelbuttontitle:@"ok" otherbuttontitles:nil];     [lol show];     [lol release]; } 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -