Force an expression that was securely decoded to allow evaluation.
SDKs
- iOS 7.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
func allowEvaluation()
Discussion
When securely decoding an NSExpression
object encoded using NSSecure
, 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 allow
.