Open paoloandrea opened 2 years ago
I wouldn't recommend using synchronous transactions as they may cause deadlocks. But if you are confident about how you use it, CoreStore does expose a DataStack.performSynchronous()
method.
Hi, this is the code I am using to save data without async. Is the method correct?
_try? DataStack.perform( synchronous: { (transaction) in guard let localDATA= try? transaction.fetchOne(From(),Where("self == %@", data.objectID )) else { return } localDATA.data = value_fordata }, waitForAllObservers: false )
Alternatively how can I save data? Can you give me an example please. Thank you
Hi, I am starting to integrate your excellent project into my app. I am now facing a problem.
How do I save to the database synchronously? I need realtime saving.
I need to replace this function
do { try MY_OBJECT.managedObjectContext?.save() } catch let error { fatalError("Failure to save context: (error)") }
I thank you in advance for your response. Thank you