Instance Method


Force an expression that was securely decoded to allow evaluation.


func allowEvaluation()


When securely decoding an NSExpression object encoded using NSSecureCoding, evaluation is disabled because it is potentially unsafe to evaluate expressions you get out of an archive.

Before you enable evaluation, you should validate key paths, selectors, etc to ensure no erroneous or malicious code will be executed. Once you’ve preflighted the expression, you can enable the expression for evaluation by calling allowEvaluation.

See Also

Evaluating an Expression

func expressionValue(with: Any?, context: NSMutableDictionary?) -> Any?

Evaluates an expression using a given object and context.

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