2

Lets say- My application ABC

Application users are facing problem with application while upgrading iOS 7 to iOS 8.

Please check below scenario:

  1. iPhone 5s - iOS 7 - users installed my application (This app supports to iOS 7 not iOS 8).
  2. Users downloaded video files in document directory up to size may be 2 GB.
  3. Application working fine with iOS 7.
  4. When iOS 8 released by apple - users were upgraded devices iOS 7 to iOS 8 with above installed application.
  5. All downloaded videos lost which was saved in document dictionary but it still shows space consumed in device setting.
  6. If users download again same video then it works fine but it shows double consumed memory in device settings.

Would you please give me suggestion for above problem then I can suggest to my application users?

Amol
  • 85
  • 5
  • how do you mean _"all downloaded videos lost"_? please clarify that, because the actual document folder is always untouched during an update, but the actual path of `Documents` folder is changed in iOS8, so your procedure which gets the content of the `Documents` folder can be just wrong simply. – holex Nov 03 '14 at 12:28
  • highly unlikely the iOS8 would make a mistake here, I guess your code has a little glitch, so, please share your procedure of how you access to the `Documents` folder in your app – you can edit and extend your question any time. – holex Nov 03 '14 at 12:51
  • you can also take a look on this answer to compare it to your application: http://stackoverflow.com/questions/26610439/ios8-document-directory-path/26610726#26610726 – holex Nov 03 '14 at 12:54
  • 1) Application installed in device with iOS7. 2)Purchased all packages and downloaded video files in Documents folder 3) Video file name store in database and path getting dynamically using iOS API. 4)Application working fine with all videos and now its time to upgrade device to iOS8 5) Application still in device and now upgrading iOS7 to iOS8 6) After finished upgrade process, now launching same app. 7) Video files not found, empty file data from Documents folder. Would you please suggest solution on above scenario? If any information required then please let me know. – Amol Nov 03 '14 at 13:04
  • // get the media directory - (NSString *)mediaDirectory { NSString *filePath = [(NSString *)[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"media"]; NSError *error = nil; if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]){ BOOL resultFlag = [[NSFileManager defaultManager] createDirectoryAtPath:filePath withIntermediateDirectories:NO attributes:nil error:&error]; NSLog(@"Media folder created : %d",resultFlag); } return filePath; } – Amol Nov 03 '14 at 13:14

1 Answers1

1

We're having a similar issue - and it only surfaced now that we submitted an Update to Apple (our App crashes on launch on iOS 8.1 due to this change!!! Even though our App has deployment target of 7.0 we're affected, talk about backwards compatibility...).

Apple officially outlines what changed in this technical note: https://developer.apple.com/library/ios/technotes/tn2406/_index.html

iOS 8 changes the locations of the standard directories used for storing user and app data (e.g. Documents, Library). While the locations of these directories have always been an implementation detail, some applications improperly assume that the Documents and Library directories reside in the same directory as the application's bundle. iOS 8 splits the data of an application from the application bundle. Code which attempts to derive the path to the Documents or Library directories will return an invalid path on iOS 8. Attempting to access this path will fail, and may terminate your app.

If I understand correctly, even though you were using a proper method to locate the Documents directory on both iOS 7 and iOS 8, you will simply get two different paths. That means users who upgraded from iOS 7 to iOS 8 still have their data under the old Documents path, which resides in your App's bundle. I have no idea as to how Apple thinks we should upgrade our Apps or if there's some automatic copying going on.

I'll have to take a look with a tool like iFunBox (an iOS file explorer) to see what happens.

Johannes Rudolph
  • 35,298
  • 14
  • 114
  • 172