I am far from the main data expert, but I got this to work successfully in my situation. I think that the βconflictβ between setFetchBatchSize and setPropertiesToFetch is more a side effect of the main data, and not an error.
In my case, I made two samples. In the first case, the result type was set to NSManagedObjectResultType, and I used setFetchBatchSize to limit the amount of data actively being written to memory. In the second sample, I fill out an array of titles based on a single attribute and set the result type in NSDictionaryResultType and fetchBatchSize to 0 (infinite).
Based on testing, this scenario works just fine. All records in the original selection (with actual managed objects) are corrupted and limited by memory using fetchBatchSize. The second sample returns a simple dictionary of names. This takes much less memory than repeating all the real managed objects to access the title attribute. It makes sense that fetchBatchSize is disabled for the second sample, since it returns a fully populated dictionary as a single result, and batch processing is not suitable.
I'm not sure that I am 100% understandable here (the basic data terminology is a bit secret ...), but the bottom line is that I think that everything works as intended.
source share