I use two persistent stores: first is read-only for default (built-in) app's data, second is read-write for user data. The issue occurs once user add any data in second store. In this case during execution of performFetch: method of NSFetchedResultsController I see the following message in debug console:
CoreData: error: batched fetch request asked to fetch 1 objects but
received 2 objects as (
"entity: Product; id: 0xd000000000340002 <x-coredata://A570FA00-5B60-4C21-A9B1-8A49C2AAC58B/Product/p13> ; data: <fault>)",
"entity: Product; id: 0xd000000000340004 <x-coredata://84F31C0F-844D-44DD-BB2F-CC766BED8331/Product/p13> ; data: <fault>)"
)
It's clear for me that CoreData interprets the situation as error because last parts of Managed ObjectIDs are the same:
Product/p13
For some reason CoreData doesn't take in account that these objects are from different stores: A570FA00-5B60-4C21-A9B1-8A49C2AAC58B and 84F31C0F-844D-44DD-BB2F-CC766BED8331 correspondingly.
Except error message in console everything works correctly. But I would prefer not to see it. Does anybody have an idea of how to resolve such a different stores ObjectID's collision?
affectedStores
property of the fetch request for the FRC.fetchBatchSize
for the fetch? I believe in that case the FRC fetches all the objectIDs at first, then uses a subset of them to select a batch. Have you tried enabling SQLDebug to see better what's going on?