I'm using the Xcode 6 document based application with core data template for OS X, which sets up the core data stack behind the scenes (no visible init code). Now I need to perform a simple core data lightweight migration and I have created the new versioned model and activated it. Do I really have to implement the core data stack initialisation by hand just to be able to pass migration permissions? If yes, where should the core data stack be initialised so that it will override the default?
相关问题
- Core Data lightweight migration crashes after App
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
- Get the NSRange for the visible text after scroll
- UIPanGestureRecognizer is not working in iOS 13
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- Using if let syntax in switch statement
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
- Automator: How do I use the Choose from List actio
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
You mentioned in a comment that you're using the document-based app template-- which is a crucial detail left out of the original question.
With this template you're using a subclass of
NSPersistentDocument
. If you want to configure migration withNSPersistentDocument
, you need to overrideconfigurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error:
. Your implementation would callsuper
's implementation with a different set of options. Something like this: