Re: Core Data Fetches + Transient Properties + NSPredicateEditor = Sadness
Re: Core Data Fetches + Transient Properties + NSPredicateEditor = Sadness
- Subject: Re: Core Data Fetches + Transient Properties + NSPredicateEditor = Sadness
- From: "Melissa Turner" <email@hidden>
- Date: Mon, 20 Apr 2009 11:23:48 -0700 (PDT)
- Importance: Normal
On Mon, April 20, 2009 11:02 am, Jerry Krinock wrote:
> Makes me wonder why NSFetchRequest even supports a predicate, since
> its predicate has all these limitations and is supposedly more
> expensive when compared to fetching all objects and then using -
> [NSArray filteredArrayWithPredicate:] ? It would have saved me a day
> on the learning curve had it not been there for me to hang myself with.
>
filteredArrayWithPredicate: is only an option if you have a relatively
small dataset. There's overhead to loading an object into memory, both in
terms of memory and CPU cycles.
Doing filtering in memory is a code smell. It generally signals that
you're fetching against the wrong entity, or that your model needs to be
tweaked to be more efficient.
+Melissa
_______________________________________________
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