Instance Method

allowEvaluation()

Forces a predicate that was securely decoded to allow evaluation.

Declaration

func allowEvaluation()

Discussion

When securely decoding NSPredicate objects that are encoded using NSSecureCoding, evaluation is disabled because it is potentially unsafe to evaluate predicates you get out of an archive.

Before you enable evaluation, you should validate key paths, selectors, and other details to ensure no erroneous or malicious code will be executed. Once you’ve verified the predicate, you can enable the receiver for evaluation by calling allowEvaluation().

See Also

Evaluating a Predicate

func evaluate(with: Any?) -> Bool

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

func evaluate(with: Any?, substitutionVariables: [String : Any]?) -> Bool

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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software