diff --git a/JGE/src/iOS/wagicAppDelegate.m b/JGE/src/iOS/wagicAppDelegate.m index 6b6a6b90b..2c3c813ea 100755 --- a/JGE/src/iOS/wagicAppDelegate.m +++ b/JGE/src/iOS/wagicAppDelegate.m @@ -149,6 +149,12 @@ { NSString *oldPath = [NSString stringWithFormat: @"%@/%@", docsPath, zipFile]; NSString *newPath = [NSString stringWithFormat: @"%@/%@", userPath, zipFile]; + if ( [fileManager fileExistsAtPath: newPath] ) + { + NSLog(@"Removing old file at %@", newPath); + [fileManager removeItemAtPath: newPath error: &error]; + } + error = nil; [fileManager moveItemAtPath: oldPath toPath:newPath error: &error]; NSLog(@"Moving %@ to %@", oldPath, newPath); @@ -163,6 +169,12 @@ { NSString *oldPath = [NSString stringWithFormat: @"%@/%@", docsPath, zipFile]; NSString *newPath = [NSString stringWithFormat: @"%@/%@", resPath, zipFile]; + if ( [fileManager fileExistsAtPath: newPath] ) + { + NSLog(@"Removing old file at %@", newPath); + [fileManager removeItemAtPath: newPath error: &error]; + } + error = nil; [fileManager moveItemAtPath: oldPath toPath:newPath error: &error]; NSLog(@"Moving %@ to %@", oldPath, newPath);