Source database only returns unique managed objects
I am fetching kernel data that sets a predicate like this:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"identifier IN %@", favoritesIDs];
If there are duplicate items in the favoriteIDs array, the select query returns only 1 managed object. How can I ensure that multiple copies are received? Thanks.
+2
a source to share
1 answer
Executing a fetch query in a context will never return more than one instance for any given managed entity context; you will have to manage the number of virtual instances in some other way. In fact, any defective object that you previously retrieved from the context will result in the same instance of that object in subsequent requests made against the context (so you can end up in the same object instance even from multiple requests).
+3
a source to share