Hey all,
So im having some problems with plists. I am trying to save a boolean stating if its the first run? here is my code that im using for that:
NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *finalPath = [path stringByAppendingPathComponent:@"Others.plist"];
NSMutableDictionary *plistData = [[NSMutableDictionary dictionaryWithContentsOfFile:finalPath] retain];
BOOL firstRun = (BOOL)[[plistData valueForKey: @"Firstrun"] boolValue];
if(firstRun == YES) {
EnterName * en = [EnterName node];
[[Director sharedDirector] runWithScene:en];
[plistData setObject:[NSNumber numberWithBool:NO] forKey:@"Firstrun"];
[plistData writeToFile:finalPath atomically:YES];
} else {
MenuScene * ms = [MenuScene node];
[[Director sharedDirector] runWithScene:ms];
}
If i put NSLogs in there it shows the change but if i get out of the game and back in it didnt save it. Do plists only save while in the game and then reset when it gets out?
Thanks
-Lars