0 Replies
      Latest reply on Aug 23, 2019 3:28 AM by alienspaces
      alienspaces Level 1 Level 1 (20 points)

        I have a MOM that has multiple configurations. One configuration is for Core Data for CloudKit, and another is for a local store. There are no relationships between the entities in the local configration and the cloudkit configuration, so practically I could load my local store into a seperate NSPersistentContainer, if I moved my local configuration to a new MOM. However, is it possible to delay the loading of some stores in a MOM?


        The more I think about it, the less feasable it probably is. At present all stores are loaded into an NSPersistentCloudKitContainer in one shot, but I would like to just set the local store description on the container, and perform loadPersistentStores. Once my app is in a specific state, I would like to add the cloudkit store description to the container's list of persistent store descriptions and then call loadPersistentStores again, hoping that the container would load the cloudkit configuration's newly added store description, and not attempt to reload the local store.


        I can see why this could be problematic, given that you could have relationships that can't be realized until all store descriptions/configurationss for a container are loaded.


        Is this an approach I can take, or are containers not designed to be used in this way?