I try to do the following simple thing:
NSArray * entities = [context executeFetchRequest:inFetchRequest error:&fetchError];
Nothing fancy.
Executing fetch request must happen from the thread where context was created.
Remember it is not thread safe and trying to executeFetchRequest
from another thread will cause unpredictable behavior.
In order to do this correctly, use
[context performBlock: ^{
NSArray * entities = [context executeFetchRequest:inFetchRequest error:&fetchError];
}];
This will executeFetchRequest
in the same thread as context, which may or may not be the main thread.