Last Updated: December 01, 2021
· ptgoetz

Enable Core Data Auto Migration in Sandbox

Core Data Automatic Migration for NSPersistentDocument requires saving in place, which won't work in a sandbox-enabled app (even with Read/Write for user selected files).

The solution is to add the following temporary entitlements:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

This allows the user to open and seamlessly migrate core data documents anywhere on the system (including mounted volumes).

After getting auto-migration working, log a bug with apple to encourage them to provide a better solution for working with Core Data in sandboxed apps:

1 Response
Add your response

If you have more complex requirements, you might find the following helpful:

over 1 year ago ·