• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Predicate for Array Controller - only parents with children
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Predicate for Array Controller - only parents with children - SOLVED
      • From: Steve Cronin <email@hidden>
References: 
 >Predicate for Array Controller - only parents with children (From: Steve Cronin <email@hidden>)

  • Prev by Date: Re: using dvd as input source to core video api
  • Next by Date: How to access built-in English dictionary?
  • Previous by thread: Re: Predicate for Array Controller - only parents with children
  • Next by thread: Re: Predicate for Array Controller - only parents with children - SOLVED
  • Index(es):
    • Date
    • Thread