0

I execute core data request not on main thread when my app is called to do background fetch (app state is background), and method freezes forever. But when I use main thread, it works.

Should I always use main thread for core data when in background mode? Does there is some apple doc about it?

user996142
  • 2,753
  • 3
  • 29
  • 48
  • There is no such restriction. Unfortunately, your question lacks any useful information for anyone to provide assistance. – Jody Hagins Oct 16 '15 at 12:38
  • Thanks. Which info should I provide? I create private queue - based context, set main context as its parent, and execute fetchRequest. It works when app is active or inactive, but not when app is background – user996142 Oct 16 '15 at 13:00
  • Code of how you handle running in the background, and code for what you do while running in the background. – Jody Hagins Oct 16 '15 at 13:38
  • Are you *always* using either `performBlock` or `performBlockAndWait` when accessing Core Data? – Tom Harrington Oct 16 '15 at 16:31
  • @TomHarrington yes, so my code runs in correct thread (the one used by context) – user996142 Oct 16 '15 at 16:34

0 Answers0