• 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: NSPredicate and nil variables.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPredicate and nil variables.


  • Subject: Re: NSPredicate and nil variables.
  • From: mmalcolm crawford <email@hidden>
  • Date: Wed, 6 Jul 2005 20:14:21 -0700


On Jul 6, 2005, at 5:19 PM, Óscar Morales Vivó wrote:

I've understood how to build predicates with variables, how to instantiate them and do fetch requests on them. However I'm not sure how the predicate will behave if any of the predicate's variables ends up being nil, especially for things like dates where I'm not sure how a zero would be interpreted.

Do you mean you want to use predicateWithSubstitutionVariables?

<http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/ Articles/pCreating.html#//apple_ref/doc/uid/TP40001793-219639-BCIIHDCH>

"To create a valid predicate to evaluate against an object, you use the NSPredicate method predicateWithSubstitutionVariables: to pass in a dictionary that contains the variables to be substituted. (Note that the dictionary must contain key-value pairs for all the variables specified in the predicate.)"

(That constraint should be mentioned in the API reference...)

mmalc

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSPredicate and nil variables.
      • From: Óscar Morales Vivó <email@hidden>
References: 
 >NSPredicate and nil variables. (From: Óscar Morales Vivó <email@hidden>)

  • Prev by Date: Re: Simulate Photoshop's "Overlay" compositing method
  • Next by Date: Re: NSPredicate and nil variables.
  • Previous by thread: NSPredicate and nil variables.
  • Next by thread: Re: NSPredicate and nil variables.
  • Index(es):
    • Date
    • Thread