<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSSortDescriptor/allowEvaluation()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSortDescriptor(im)allowEvaluation"
  },
  "title" : "allowEvaluation()"
}
-->

# allowEvaluation()

Forces a securely decoded sort descriptor to allow evaluation.

```
func allowEvaluation()
```

## Discussion

When securely decoding [`NSSortDescriptor`](/documentation/Foundation/NSSortDescriptor) objects that are encoded using [`NSSecureCoding`](/documentation/Foundation/NSSecureCoding), evaluation is disabled because it is potentially unsafe to evaluate descriptors you get out of an archive.

Before you enable evaluation, you should validate key paths, selectors, and related properties to ensure no erroneous or malicious code will be executed. Once you’ve preflighted the sort descriptor, you can enable the sort descriptor for evaluation by calling [`allowEvaluation()`](/documentation/Foundation/NSSortDescriptor/allowEvaluation()).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)