smart way to load entityNames from the model file

This commit is contained in:
John Rommel Estropia
2015-02-22 22:01:23 +09:00
parent f6ced13577
commit 8f77818015
8 changed files with 88 additions and 44 deletions

View File

@@ -105,13 +105,14 @@ public final class DataTransaction {
HardcoreData.assert(!self.isCommitted, "Attempted to commit a DataTransaction more than once.")
self.isCommitted = true
let result = self.context.saveSynchronously()
self.result = result
GCDQueue.Main.async {
let semaphore = GCDSemaphore(0)
self.context.saveAsynchronouslyWithCompletion { (result) -> Void in
self.result = result
completion(result: result)
semaphore.signal()
}
semaphore.wait()
}
/**