A very strange problem with my iPhone App. We have an app that has been approved and sold on the App Store. It contains the function of downloading some database updates. Updating occurs through ZIP through HTTP. The problem is that I cannot save this downloaded ZIP, because I get the message "The operation could not be completed. The operation error was not resolved."
BUT: this happens on 2 phones out of 10. If the phone cannot save the file, it cannot do this at all. If I restart the application from the store, it will not change it. But those phones that are capable of saving ZIP are always capable. All phones work with the same version of iOS, and all of them are iPhone 4. It really drives me crazy.
If I run Xcode, one phone does not give errors in debugging, which gives another. And they always give.
Here is the code:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection { [activeResponse release]; [theConnection release]; NSLog(@"%d", [receivedData length]); NSString *s = [[NSString alloc] initWithData:receivedData encoding:NSASCIIStringEncoding]; NSLog(@"%@", s); [s release]; [theRequest release]; NSString *path = [NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], @"temp.zip"]; NSLog(path); NSError * error; if ([receivedData writeToFile:path options:NSDataWritingAtomic error:&error]) NSLog(@"Success"); else NSLog(@"Error"); if (error) NSLog([error description]);
Any ideas please?
Teddy source share