So the injection is finished right now, although I changed the container in singleton actor, that's the reason it won't affect anything. You assessment sounds about right. If your model container is a @State of the view, as shown in the API specification I linked above, and the view injects the container to a subview hierarchy, I'd expect that changing container triggers an update of the subview with the new container. So it's not possible to save the model data from another ModelContext to a new ModelContext, is that right? Right. If you save a model instance with a model context, and need to access the model instance from a second context, consider grabbing the persistentModelID of the instance and converting it to a new instance with the second context using model(for:). Best, —— Ziqiao Chen Worldwide Developer Relations.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: