In your position... I think I'd just be lazy and store everything in NSUserDefaults instead. You just need to store all your data in an NSDictionary, and then copy it to NSUserDefaults. This SHOULD work:
- (void)storeSavedGameData:(NSDictionary*)allMySavedData
{
NSString* savedDataKey = @"my saved game";
// Create the default "has no actual data yet" dictionary that will be the "default" data
NSDictionary* storageDict = [NSDictionary dictionaryWithObjectsAndKeys:
@"Fake data that will be replaced", savedDataKey, nil];
// Store "fake" data in the user defaults to prepare the way for the actual information
[[NSUserDefaults standardUserDefaults] registerDefaults:storageDict];
// Now copy the "real" data to memory
[[NSUserDefaults standardUserDefaults] setObject:allMySavedData forKey:savedDataKey];
// Copy the saved data to the device's hard drive / flash memory
[[NSUserDefaults standardUserDefaults] synchronize]; // Do this or nothing gets saved. :(
}
And when you need to load your saved game:
- (NSDictionary*)loadMySavedGame
{
NSString* savedDataKey = @"my saved game";
NSDictionary* loadedGame = [[NSUserDefaults standardUserDefaults] objectForKey:savedDataKey];
if( loadedGame == nil )
CCLOG(@"No saved game found."); // You should probably do something if you can't find saved data
return loadedGame;
}
Anyway, that code SHOULD work and be good enough to store the data that you've mentioned. If you feel really fancy, you can try adding stuff like "the exact time and date when this game was saved" and maybe multiple save slots and other things like that... but that's probably for another time. ;)