- (void) saveGameState { NSNumber *squareData = [NSNumber numberWithInt:*[self.gameManager returnSpotArray]]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectoryPath = [paths objectAtIndex:0]; NSString *filePath = [documentsDirectoryPath stringByAppendingPathComponent:@"appData"]; [NSKeyedArchiver archiveRootObject:squareData toFile:filePath]; }