我想知道是否可以將MR_InContext與saveWithBlock一起調用。我知道蘋果暗示甚至不會從不同線程中的核心數據對象讀取數據,所以我想知道是否應該傳遞objectId。這是我正在談論的一個例子:MagicalRecord的MR_InContext方法。安全使用?
// outside of save with block
var someManagedObject = SomeManagedObject.MR_first()
MagicalRecord.saveWithBlock({ (localContext : NSManagedObjectContext!) in
// Is this ok? should I pass the objectId instead?
var managedObjectInThread = someManagedObject.MR_InContext(localContext)
managedObjectInThread.date = NSDate()
}, completion: { (success : Bool, error : NSError!) in
// This block runs in main thread
})