project_files/HedgewarsMobile/Classes/SavedGamesViewController.m
author koda
Sat, 25 Sep 2010 18:38:05 +0200
changeset 3903 db01c37494af
parent 3898 0a9c3735a713
child 3904 22e4d74240e5
permissions -rw-r--r--
pimp-my-savagame-table
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
     1
/*
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
     3
 * Copyright (c) 2009-2010 Vittorio Giovara <vittorio.giovara@gmail.com>
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
     4
 *
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
     8
 *
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    12
 * GNU General Public License for more details.
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    13
 *
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    17
 *
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    18
 * File created on 22/09/2010.
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    19
 */
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    20
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    21
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    22
#import "SavedGamesViewController.h"
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    23
#import "SDL_uikitappdelegate.h"
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    24
#import "CommodityFunctions.h"
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    25
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    26
@implementation SavedGamesViewController
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    27
@synthesize tableView, listOfSavegames;
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    28
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    29
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    30
    return rotationManager(interfaceOrientation);
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    31
}
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    32
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    33
-(void) viewDidLoad {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    34
    self.tableView.backgroundView = nil;
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    35
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    36
    [super viewDidLoad];
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    37
}
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    38
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    39
-(void) viewWillAppear:(BOOL)animated {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    40
    [super viewWillAppear:animated];
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    41
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    42
    NSArray *contentsOfDir = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:SAVES_DIRECTORY() error:NULL];
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    43
    NSMutableArray *array = [[NSMutableArray alloc] initWithArray:contentsOfDir copyItems:YES];
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    44
    self.listOfSavegames = array;
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    45
    [array release];
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    46
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    47
    [self.tableView reloadData];    
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    48
}
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    49
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    50
-(IBAction) buttonPressed:(id) sender {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    51
    playSound(@"backSound");
3903
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    52
    [self.tableView setEditing:NO animated:YES];
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    53
    [[self parentViewController] dismissModalViewControllerAnimated:YES];
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    54
}
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    55
3903
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    56
// modifies the navigation bar to add the "Add" and "Done" buttons
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    57
-(IBAction) toggleEdit:(id) sender {
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    58
    BOOL isEditing = self.tableView.editing;
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    59
    [self.tableView setEditing:!isEditing animated:YES];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    60
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    61
    UIBarButtonItem *barButton = (UIBarButtonItem *)sender;
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    62
    if (isEditing)
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    63
        [barButton setTitle:NSLocalizedString(@"Edit",@"")];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    64
    else
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    65
        [barButton setTitle:NSLocalizedString(@"Commit",@"")];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    66
}
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    67
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    68
#pragma mark -
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    69
#pragma mark Table view data source
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    70
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    71
    return 1;
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    72
}
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    73
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    74
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    75
    return [self.listOfSavegames count];
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    76
}
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    77
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    78
-(UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
    79
    static NSString *CellIdentifier = @"Cell";
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
    80
3903
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    81
    EditableCellView *editableCell = (EditableCellView *)[aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    82
    if (editableCell == nil) {
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    83
        editableCell = [[[EditableCellView alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    84
        editableCell.delegate = self;
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    85
    }
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    86
    editableCell.tag = [indexPath row];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    87
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    88
    editableCell.textField.text = [[self.listOfSavegames objectAtIndex:[indexPath row]] stringByDeletingPathExtension];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    89
    editableCell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    90
    
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    91
    UIImage *addImg = [UIImage imageWithContentsOfFile:@"plus.png"];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    92
    UIButton *customButton = [UIButton buttonWithType:UIButtonTypeContactAdd];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    93
    customButton.tag = [indexPath row];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    94
    [customButton setImage:addImg forState:UIControlStateNormal];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    95
    [customButton addTarget:self action:@selector(duplicateEntry:) forControlEvents:UIControlEventTouchUpInside];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    96
    editableCell.editingAccessoryView = customButton;
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    97
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    98
    return (UITableViewCell *)editableCell;
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
    99
}
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   100
/*
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   101
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger) section {
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   102
    UITableViewCellEditingStyleInsert
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   103
}*//*
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   104
-(UITableViewCellEditingStyle) tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   105
    return UITableViewCellEditingStyleInsert;
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   106
}*/
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   107
3903
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   108
-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   109
    NSUInteger row = [indexPath row];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   110
    [(EditableCellView *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:0]] save:nil];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   111
    
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   112
    NSString *saveName = [self.listOfSavegames objectAtIndex:row];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   113
    NSString *currentFilePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),saveName];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   114
    [[NSFileManager defaultManager] removeItemAtPath:currentFilePath error:nil];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   115
    [self.listOfSavegames removeObject:saveName];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   116
    
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   117
    [self.tableView reloadData];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   118
}
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   119
3903
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   120
-(void) duplicateEntry:(id) sender {
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   121
    UIButton *button = (UIButton *)sender;
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   122
    NSUInteger row = button.tag;
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   123
    
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   124
    [(EditableCellView *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:0]] save:nil];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   125
    NSString *currentSaveName = [self.listOfSavegames objectAtIndex:row];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   126
    NSString *newSaveName = [[currentSaveName stringByDeletingPathExtension] stringByAppendingFormat:@" %d.hws",[self.listOfSavegames count]];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   127
    
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   128
    NSString *currentFilePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),currentSaveName];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   129
    NSString *newFilePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),newSaveName];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   130
    [[NSFileManager defaultManager] copyItemAtPath:currentFilePath toPath:newFilePath error:nil];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   131
    [self.listOfSavegames addObject:newSaveName];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   132
    [self.listOfSavegames sortUsingSelector:@selector(compare:)];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   133
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   134
    //[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:[self.listOfSavegames indexOfObject:newSaveName] inSection:0]] withRowAnimation:UITableViewRowAnimationFade];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   135
    [self.tableView reloadData];
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
   136
}
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
   137
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   138
#pragma mark -
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   139
#pragma mark Table view delegate
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   140
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   141
    [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   142
    
3903
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   143
    [(EditableCellView *)[self.tableView cellForRowAtIndexPath:indexPath] save:nil];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   144
    
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   145
    NSString *filePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:[indexPath row]]];
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   146
    
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   147
    NSDictionary *allDataNecessary = [NSDictionary dictionaryWithObjectsAndKeys:
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   148
                                      [NSDictionary dictionary],@"game_dictionary",
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   149
                                      filePath,@"savefile",
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   150
                                      [NSNumber numberWithBool:NO],@"netgame",
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   151
                                      nil];
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   152
    [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:allDataNecessary];
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
   153
}
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
   154
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   155
#pragma mark -
3903
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   156
#pragma mark editableCellView delegate
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   157
// rename old file if names differ
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   158
-(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue {
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   159
    NSString *oldFilePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:tagValue]];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   160
    NSString *newFilePath = [NSString stringWithFormat:@"%@/%@.hws",SAVES_DIRECTORY(),textString];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   161
    
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   162
    if ([oldFilePath isEqualToString:newFilePath] == NO) {
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   163
        [[NSFileManager defaultManager] moveItemAtPath:oldFilePath toPath:newFilePath error:nil];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   164
        [self.listOfSavegames replaceObjectAtIndex:tagValue withObject:[textString stringByAppendingString:@".hws"]];
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   165
    }
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   166
    
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   167
}
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   168
db01c37494af pimp-my-savagame-table
koda
parents: 3898
diff changeset
   169
#pragma mark -
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   170
#pragma mark Memory Management
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   171
-(void) didReceiveMemoryWarning {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   172
    [super didReceiveMemoryWarning];
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   173
}
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
   174
3898
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   175
-(void) viewDidUnload {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   176
    self.tableView = nil;
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   177
    self.listOfSavegames = nil;
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   178
    [super viewDidUnload];
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   179
}
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   180
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   181
-(void) dealloc {
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   182
    [tableView release];
0a9c3735a713 implemented reloading savefiles
koda
parents: 3893
diff changeset
   183
    [listOfSavegames release];
3893
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
   184
    [super dealloc];
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
   185
}
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
   186
568bfd083465 allow more flexibility between viewcontrollers, also added stub pages for saved games
koda
parents:
diff changeset
   187
@end