additional safety for transactions by splitting between sync and async subclasses

This commit is contained in:
John Rommel Estropia
2015-02-28 10:37:01 +09:00
parent 2da04d2d94
commit 59cd505dc6
7 changed files with 234 additions and 102 deletions

View File

@@ -66,7 +66,7 @@ public class DataStack {
/**
Initializes a DataStack from an NSManagedObjectModel.
:param: modelName the name of the "momd" (or xcdatamodeld) file.
:param: managedObjectModel the NSManagedObjectModel of the (.xcdatamodeld) model file.
*/
public required init(managedObjectModel: NSManagedObjectModel) {
@@ -82,8 +82,6 @@ public class DataStack {
return mapping
}
println(self.entityNameMapping)
self.rootSavingContext.parentStack = self
}
@@ -268,7 +266,7 @@ public class DataStack {
// MARK: Internal
internal let mainContext: NSManagedObjectContext
internal let transactionQueue: GCDQueue = .createSerial("com.hardcoredata.datastack.transactionqueue")
internal let childTransactionQueue: GCDQueue = .createSerial("com.hardcoredata.datastack.childtransactionqueue")
internal func entityNameForEntityClass(entityClass: NSManagedObject.Type) -> String? {