12

Anyone getting the following error with Xcode 8 beta 6: Attempt to serialize store access on non-owning coordinator? Any advice how to eliminate it would be greatly appreciated.

3
  • You need to provide more context in your question. Is this a runtime error in your app? A compile error? Something else? Provide more details and relevant code as appropriate.
    – rmaddy
    Aug 18, 2016 at 4:59
  • 1
    It's a runtime error that I get when the following line of code is executed: let count = self.backgroundMOC.countOfFetchObjects(entityName: "Distribution", predicate: nil)!
    – fivewood
    Aug 18, 2016 at 6:46
  • have the same problem, maybe this is beta case and will be fixed in stable version
    – Adam Smaka
    Aug 31, 2016 at 9:10

1 Answer 1

6

I saw the same error on performing performFetch on iOS 10.0.1:

- (void) refreshFetchedResults:(NSFetchedResultsController *)controller {

    [self configureFetchRequest:controller.fetchRequest];

        NSError *error = nil;
        if (![controller performFetch:&error]) {
            DDLogError(@"Unresolved error %@, %@", error, [error userInfo]);
        }
    }
}

As reported here, performing a save on the managedObjectContext associated with the NSFetchedResultsController before executing performFetch stops the warning from appearing. (In my case, there were changes to be saved.)

3
  • 5
    Sorry I must disagree with this solution. It might solve the problem, but there are many cases where one might not want to save a context to perform a fetch. Context save may be expensive if done often (compared to a fetch), and there are cases where you may want to mutate a context, fetch objects and discard the changes (not propagate to the parent context, in a multi-context environment). Though, I must admit, I can't find a solution to the same problem we're having… still investigating, will follow up if we find an answer :) Nov 10, 2016 at 17:03
  • 3
    Agreed it may not be practical in all scenarios, but it addresses OP's question.
    – stephent
    Nov 10, 2016 at 17:26
  • 2
    @MichaMazaheri I know this question is a bit old, but did you find a solution to this problem?
    – SAHM
    Sep 12, 2018 at 18:10

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.