Instance Method

evaluateWithObject:substitutionVariables:

Returns a Boolean value indicating whether the specified object matches the conditions specified by the predicate after substituting in the values in a given variables dictionary.

Declaration

- (BOOL)evaluateWithObject:(id)object substitutionVariables:(NSDictionary<NSString *,id> *)bindings;

Parameters

object

The object against which to evaluate the predicate.

variables

The substitution variables dictionary. The dictionary must contain key-value pairs for all variables in the predicate.

Return Value

YES if object matches the conditions specified by the predicate after substituting in the values in variables for any replacement tokens, otherwise NO.

Discussion

This method returns the same result as the two step process of first invoking predicateWithSubstitutionVariables: on the predicate and then invoking evaluateWithObject: on the returned value. This method is optimized for situations which require repeatedly evaluating a predicate with substitution variables with different variable substitutions.

See Also

Evaluating a Predicate

- evaluateWithObject:

Returns a Boolean value indicating whether the specified object matches the conditions specified by the predicate.

- allowEvaluation

Forces a predicate that was securely decoded to allow evaluation.