Core Data nested managed object contexts and frequent deadlocks / freezes

前端 未结 7 1036
囚心锁ツ
囚心锁ツ 2020-12-04 14:31

I have a problem that is almost identical to the problem described by this person here, but it hasn\'t get answered:

http://www.cocoabuilder.com/arc

7条回答
  •  星月不相逢
    2020-12-04 15:07

    I just wanted to chime in and agree completely with avoiding nested contexts. I've been working in iOS 7 with nested contexts (main queue child and private queue parent) and NSFetchedResultsControllers and had an impossible to fix deadlock issue. I switched over to using independent MOCs and save notifications and the issue disappeared.

    If anyone needs a quick guide for how to change their code over, this page has code that's ready to go (just ignore the nested context recommendation):

    http://www.cocoanetics.com/2012/07/multi-context-coredata/

提交回复
热议问题