简体   繁体   中英

iOS - Persisted file URLs invalid after update

An app I'm working on persists video and audio files to disk, and then saves the file's URL plus other metadata into a Core Data database. I'm using the NSSearchPathForDirectoriesInDomains() function (arguments: NSDocumentDirectory , NSUserDomainMask , YES ), appending the filename to the string, and then sending that to NSURL's -initFileURLWithPath: .

I've made a small change to the managed object model, following all the migrations processes.

In testing, the only thing that isn't working are video and audio files captured with the earlier version do not playback with the update.

For Example:

  1. Testers download the 1.0 version from App Store
  2. Tester takes 3 videos
  3. Tester is able to playback those three videos
  4. Tester downloads 1.0.1 version from TestFlight
  5. Tester is now UNABLE to playback the three videos

The code to capture and playback the videos has not changed between versions (I'm using a standard MPMoviePlayerController).

The Core Data managed object model entity "Video" wasn't modified in the migration (another entity was: "User").

My gut feeling is this is a code signing / provisioning profile / App ID problem. If I do the above steps, but instead of downloading 1.0.1 from TestFlight, I build and run in Xcode I have no issue. I've code signed the 1.0.1 build with the distribution certs, and am using the same App ID as the App Store version, the only thing I can't obviously do is sign the TestFlight build with the App Store profile.

What can I do?

I was persisting the entire URL of the media file, not just the unique part.

Says here that during an update iTunes installs the update in a new app directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM