Context
I am building an app that uses CoreData
. When opening a NewEntityForm
, the app creates an Object
of this Entity
for the User to manipulate. When the User saves his changes, it gets saved to Context
, otherwise it gets discarded using object.rollback()
.
This means that at any time there can be Uncommitted Objects
in the given Context
. However, I only want to present the saved ones inside the App expect from the NewEntityForm
.
Code
This Code fetches all Objects, saved to context and temporary.
FetchRequest(sortDescriptors: [SortDescriptor(\.name, order: .forward)])
Question
- How can I adjust my
FetchRequest
so that it only returnsObjects
already saved to theContext
and ignoresUncommitted Objects
.