project_files/HedgewarsMobile/Classes/SavedGamesViewController.m
changeset 8441 a00b0fa0dbd7
parent 6869 a187c280dd3d
child 10108 c68cf030eded
equal deleted inserted replaced
8440:ea4d6a7a2937 8441:a00b0fa0dbd7
   201 -(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue {
   201 -(void) saveTextFieldValue:(NSString *)textString withTag:(NSInteger) tagValue {
   202     if (self.listOfSavegames == nil)
   202     if (self.listOfSavegames == nil)
   203         [self updateTable];
   203         [self updateTable];
   204     NSString *oldFilePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:tagValue]];
   204     NSString *oldFilePath = [NSString stringWithFormat:@"%@/%@",SAVES_DIRECTORY(),[self.listOfSavegames objectAtIndex:tagValue]];
   205     NSString *newFilePath = [NSString stringWithFormat:@"%@/%@.hws",SAVES_DIRECTORY(),textString];
   205     NSString *newFilePath = [NSString stringWithFormat:@"%@/%@.hws",SAVES_DIRECTORY(),textString];
   206     
   206 
   207     if ([oldFilePath isEqualToString:newFilePath] == NO) {
   207     if ([oldFilePath isEqualToString:newFilePath] == NO) {
   208         [[NSFileManager defaultManager] moveItemAtPath:oldFilePath toPath:newFilePath error:nil];
   208         [[NSFileManager defaultManager] moveItemAtPath:oldFilePath toPath:newFilePath error:nil];
   209         [self.listOfSavegames replaceObjectAtIndex:tagValue withObject:[textString stringByAppendingString:@".hws"]];
   209         [self.listOfSavegames replaceObjectAtIndex:tagValue withObject:[textString stringByAppendingString:@".hws"]];
   210     }
   210     }
   211     
   211 
   212 }
   212 }
   213 
   213 
   214 #pragma mark -
   214 #pragma mark -
   215 #pragma mark Memory Management
   215 #pragma mark Memory Management
   216 -(void) didReceiveMemoryWarning {
   216 -(void) didReceiveMemoryWarning {