mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-21 08:59:08 +01:00
Added ability to use non-contiguous transactions to be done on the main thread. This is useful for temporary changes such as partial input forms.
This commit is contained in:
@@ -34,7 +34,7 @@ internal extension NSManagedObjectContext {
|
||||
|
||||
// MARK: Internal
|
||||
|
||||
internal weak var parentTransaction: DataTransaction? {
|
||||
internal weak var parentTransaction: BaseDataTransaction? {
|
||||
|
||||
get {
|
||||
|
||||
@@ -48,13 +48,14 @@ internal extension NSManagedObjectContext {
|
||||
}
|
||||
}
|
||||
|
||||
internal func temporaryContextInTransaction(transaction: DataTransaction?) -> NSManagedObjectContext {
|
||||
internal func temporaryContextInTransactionWithConcurrencyType(concurrencyType: NSManagedObjectContextConcurrencyType) -> NSManagedObjectContext {
|
||||
|
||||
let context = NSManagedObjectContext(concurrencyType: .PrivateQueueConcurrencyType)
|
||||
let context = NSManagedObjectContext(concurrencyType: concurrencyType)
|
||||
context.parentContext = self
|
||||
context.parentStack = self.parentStack
|
||||
context.setupForHardcoreDataWithContextName("com.hardcoredata.temporarycontext")
|
||||
context.shouldCascadeSavesToParent = (self.parentStack?.rootSavingContext == self)
|
||||
context.retainsRegisteredObjects = true
|
||||
|
||||
return context
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user