Re: fetch and predicate help
Re: fetch and predicate help
- Subject: Re: fetch and predicate help
- From: mmalc crawford <email@hidden>
- Date: Wed, 5 Sep 2007 22:02:35 -0700
On Sep 5, 2007, at 9:57 PM, Gonzalo Castro wrote:
I have these entities with inverse relationship: Department <-->>
Employee. I need to know if a specific department instance has zero
employees.
I can simply ask the department instance for its "employee" property
and check its count. This works fine but should I be using a fetch
to get this information instead?
No (<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdFAQ.html#//apple_ref/doc/uid/TP40001802-242985
>).
If so, what's the advantage of doing a fetch vs accessing the
instance's property directly?
None -- in fact it is counter-productive. There's considerably
greater overhead in executing a fetch than simply accessing the
instance variable.
mmalc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden