You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using 4 different Managed Object Models and their 4 respective Persistent Store Coordinators.
There are 2 Managed Object Context for each coordinator, one context is for main thread, and other is for background lengthy operations.
I'm pretty sure i'm not accessing contexts on multiple threads, doing all operations within perform block of respective context.
I'm using swift 2.0
I'm not sure whats happening here, plz help.
Following is the code where i'm accessing data, and getting this warning
//Using this context for main thread
internal lazy var managedObjectContext: NSManagedObjectContext? = {
let coordinator = self.persistentStoreCoordinator
if coordinator == nil {
return nil
}
var managedObjectContext = NSManagedObjectContext(concurrencyType: NSManagedObjectContextConcurrencyType.MainQueueConcurrencyType)
managedObjectContext.persistentStoreCoordinator = coordinator
return managedObjectContext
}()
//Using this context for background operations
internal lazy var managedObjectContext_lenghtyThread: NSManagedObjectContext? = {
if self.managedObjectContext == nil{return nil}
var managedObjectContext_lenghtyThread = NSManagedObjectContext(concurrencyType: NSManagedObjectContextConcurrencyType.PrivateQueueConcurrencyType)
managedObjectContext_lenghtyThread.parentContext = self.managedObjectContext
return managedObjectContext_lenghtyThread
}()
//Here i'm getting this warning
let fetchRequest = NSFetchRequest(entityName: self.ENTITY_SWCPickedProduct)
self.managedObjectContext_lenghtyThread?.performBlock({ () -> Void in
let resultOject:AnyObject? = try?
self.managedObjectContext_lenghtyThread!.executeFetchRequest(fetchRequest)
if resultOject is [SWCPickedProduct]
{
}
})
The text was updated successfully, but these errors were encountered:
Hi i'm getting following warnings in my code.
I'm using 4 different Managed Object Models and their 4 respective Persistent Store Coordinators.
There are 2 Managed Object Context for each coordinator, one context is for main thread, and other is for background lengthy operations.
I'm pretty sure i'm not accessing contexts on multiple threads, doing all operations within perform block of respective context.
I'm using swift 2.0
I'm not sure whats happening here, plz help.
Following is the code where i'm accessing data, and getting this warning
The text was updated successfully, but these errors were encountered: