paulw11 / Seam3

Cloudkit based persistent store for Core Data
Other
209 stars 25 forks source link

Fix for occasional crash #130

Closed tifroz closed 3 years ago

tifroz commented 3 years ago

According the doc, fetch'ed() objects are supposed to be register with the context and therefore be immediately available via registeredObject(for:), but this occasionally fails in my app under very specific circumstances.

object(with:) essentially does the same but will refetch from the persistent store when the object isn't registered. So I think it is a safe replacement, and it fixes the crashes in my app.