开发者

Core data fetch only returns unique managed objects

I execute a core data fetch which specifies a predicate as follows:

NSPredicate *predicate = [NSPredicate predic开发者_如何学编程ateWithFormat:@"identifier IN %@", favoritesIDs];

When there are duplicate items in the favoriteIDs array, the fetch request only returns 1 managed object. How can I ensure that more than one instance is fetched? Thank you.


Executing a fetch request on a context will never return more than one instance for any given managed object context; you would have to manage the number of virtual instance in some other fashion. In fact, any faulted object that you previously obtained from a context will result in the same instance of that object in later requests executed against the context (so you can end up with the same instance of an object even from multiple request executions).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜