Re: NSPredicate and nil variables.
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