Re: Predicate for Array Controller - only parents with children
Re: Predicate for Array Controller - only parents with children
- Subject: Re: Predicate for Array Controller - only parents with children
- From: Timothy Larkin <email@hidden>
- Date: Sat, 24 Mar 2007 07:52:25 -0400
I have several times been mislead about the duration of some
operation by basing my timing on the debug configuration. For
instance, I discovered an operation that was very slow because the
debugger was loading a symbol table or something the first time the
operation executed.
As for the unresolved keypath, I think it is the case that if the
object being searched is based on a CoreData entity, then predicates
and bindings work only on attributes of the entity. You cannot use
arbitrarily computed functions. As I recall, this is because
predicates and bindings are operating at the SQL level, which knows
nothing about your application code. In your case, you would need to
add something like a temporary attribute, "hasChildren". Then you can
write Objective-C code to support the value of the attribute.
Finally, sometimes you may get much better performance by writing
your own filter code rather than relying on NSPredicate, especially
when relationships are involved. NSPredicate can generate an
astounding number of supernumerary fetches.
--
Timothy Larkin
Abstract Tools
Caroline, NY
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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