Nowadays all core data examples are iOS examples, so there isn't much guidance for macOS since the interesting changes to core data in macOS 10.12. But I would like to see how the NSPersistentContainer is supposed to work with a multi-document setup. Who has a good tutorial etc.? How is the stack now supposed to work? Many thanks in advance!
It doesn't seem that NSPersistentContainer is relevant to apps using NSPersistentDocument. It's not used because it's not needed.
The main purpose of NSPersistentContainer is to handle setting up the Core Data stack and creating managed object contexts. But NSPersistentDocument already does that. It also has properties that allow the same things NSPersistentContainer provides after setting up the stack. For example, if you need a new managed object context, get the coordinator using managedObjectContext.persistentStoreCoordinator and then just instantiate a new context object using that coordinator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With