cocoa - How should I be migrating CoreData documents within the app sandbox? -
i trying update coredata based application meet requirements running in sandbox. however, migrations proving difficult. seems nspersistentdocument tries migrations in-place , wants save disk without user's permission. because of this, lightweight migrations fail.
i can imagine need avoid doing migration on disk, can't figure out how in nspersistentdocument. has been suggested subclass nsdocumentcontroller , override makedocumentforurl:... check whether migrations required. assume logic @ point create new untitled document , migrate data that, i'm not sure if best approach or other approaches should considered.
how should perform migrations sandboxed core data applications?
i able work around temporary entitlements.
<?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.files.user-selected.read-write</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.security.temporary-exception.files.absolute-path.read-write</key> <string>/volumes/</string> <key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key> <string>/</string> </dict> </plist> that got automatic migration working did without sandbox enabled.
however, disabling large portion of sandbox, i'm not sure how apple react when comes time app store approval.
on developer.apple.com, recommend submitting bug when find having use temporary entitlements.
Comments
Post a Comment