阅读背景:

在后台线程上保存到CoreData Context

来源:互联网 

I am struggling with this for some time now and Apple's documentation and SO did not help so far. I was using ManagedObjectContext on a UIManagedDocument and the code below worked fine. I then decided to use Apple's template for CoreData in AppDelegate, so model, persistent store coordinator and context is created in AppDelegate. Fetching with AppDelegate's context is no problem, but background saving is an issue. I should have local context on the thread I am saving and as per Apple to have same persistance store coordinator. But the code below does not actually save the data. Can someone here please advise? Thank you.I am struggling with this for some time now and




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: