It’s a bit difficult to follow this course the way it’s narrated. I found reading the Apple docs easier.
Thank you very much for the course! I am trying to understand the inner workings of NSPersistentContainer, maybe you have some insights that could help me:
-
There is the loadPersistentStores(completionHandler:) instance method, that has to complete before I can use the container. Underneath I assume it creates and opens the sqLite database, respectively opens it if it exists already. So I wonder, what do I do when I am done with using the database? Do I just set the container variable to nil? Will this close the database at the same time? Or do I have to close the sqlite database in another way, before I can set the container to nil. I did not see an instance method on the container for this, but it feels a bit wrong to just set the container to nil, like I’m missing something.
-
If I have a share extension for my Core-Data-using-App, and I want to also access the same sqlite database from the extension via Core Data (using App Groups for storage location), I would also use a NSPersistentContainer, similarly as in my main App essentially. Since App and Share Extension can run at the same time I wonder: is this thread safe, if I read/write into the same sqlite database from both the persistentContainer in my App and the persistentContainer in my extension? My understanding (which at this point is still limited) is that this is fine and intended use of Core Data but I want to be on the safe side…
Any insight is appreciated!! Thank you very much for your help!!
For me, the opposite is true. The narrator is very cool.
The material is very clearly presented, the speech is well delivered and clear.
I really really liked the narrator. His way of delivering lectures were awesome. <3