iPhone Simulator - Restores Plist - Weird Issue

Posted by David Schiefer on Stack Overflow See other posts from Stack Overflow or by David Schiefer
Published on 2010-05-13T17:00:56Z Indexed on 2010/05/13 17:04 UTC
Read the original article Hit count: 240

Filed under:
|
|
|
|

Hi All,

today I've come across a rather weird issue. After adding code to validate a key (i added it below), the Simulator refuses to let go of the old plist file. I deleted the simulator folder in the Application Support folder, then deleted the *build directory and restarted xcode & build & run my app...still the same issue. the old plist is still there and 100% identical. I then changed the identifier and the snippet's validation keys, the plist however stayed the same. basically, no matter what i do it won't go. the same thing happens on the iphone itself.

I have checked through the code, i don't create the key anywhere, but it still returns YES for it at every restart.

Here's the code I added:

+ (void)initialize{
 ////////////////////////////SPECIFING THE PREDATA///////////////////
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSDictionary *appDefaults = [NSDictionary
         dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"protect"];

    [defaults registerDefaults:appDefaults];
}

if ([[NSUserDefaults standardUserDefaults] boolForKey:@"protect"] == NO) { [navigationController pushViewController:help animated:YES]; [help.navigationItem hidesBackButton]; } else { [window addSubview:passcode.view]; [self performSelector:@selector(responder) withObject:nil afterDelay:1]; }

as a result, it will always go for the else option, which for some reason, doesn't get executed either. I assumed an error but the log is empty and there's no crash.

© Stack Overflow or respective owner

Related posts about simulator

Related posts about plist