Reputation: 936
I have a core data entity, which has a relationship to another entity.
Entity A
has an NSSet
which contains objects of Entity B
. Entity A
is stored as a property called user
in a singleton available to every other class
Now, I want to display the latest 6 objects of Entity B
, which has a property of type NSDate
that is the gained date.
Which is the more efficient way of doing things:
NSSet
into an NSArray
Upvotes: 0
Views: 62
Reputation: 119031
Test it. It depends entirely on whether that relationship contents is already faulted into memory and how many items there are.
Already faulted AND small number of items should tend towards the set. not faulted OR large number of items towards Core Data (I.e. Fetch request with predicate).
Upvotes: 1