如何在Swift中实现NSManagedObjectContextDidSaveNotification处理程序作为完成块?

时间:2014-09-01 17:38:28

标签: ios core-data swift closures objective-c-blocks

我需要对已保存并拥有最终objectIDs的托管对象执行操作。通过完成处理程序这是一种简单的方法吗?

Utility.managedObjectContext().performBlockAndWait({
let success = Utility.managedObjectContext().save(nil)


    //do some logic but only after save was completed, and managedObject owns final objectIDs
})

0 个答案:

没有答案