Core Data nested managed object contexts and frequent deadlocks / freezes

前端 未结 7 1039
囚心锁ツ
囚心锁ツ 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:15

    I just read this SO posting where fabrice truillot de chambrier recommends not to use nested contexts at present. He gives a reference to the article Core Data Growing Pains .

    From that article:

    NSFetchedResultsController deadlocks

    You never want your application to deadlock. With NSFetchedResultsController and nested contexts, it’s pretty easy to do. Using the same UIManagedDocument setup described above, executing fetch requests in the private queue context while using NSFetchedResultsController with the main queue context will likely deadlock. If you start both at about the same time it happens with almost 100% consistency. NSFetchedResultsController is probably acquiring a lock that it shouldn’t be. This has been reported as fixed for an upcoming release of iOS.

    radar://11861499 fixed in an upcoming release

    This seems to describe exactly your issue.

提交回复
热议问题