<!--
{
  "availability" : [
    "iOS: 2.0.0 - 2.0.0",
    "iPadOS: 2.0.0 - 2.0.0",
    "tvOS: 9.0.0 - 9.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/useStoredAccessor()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(cm)useStoredAccessor"
  },
  "title" : "useStoredAccessor()"
}
-->

# useStoredAccessor()

Returns `true` if the stored value methods [`storedValue(forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/storedValue(forKey:)) and [`takeStoredValue(_:forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/takeStoredValue(_:forKey:)) should use private accessor methods in preference to public accessors.

```
class func useStoredAccessor() -> Bool
```

## Discussion

Returning [`NO`](/documentation/ObjectiveC/NO) causes the stored value methods to use the same accessor method or instance variable search order as the corresponding basic key-value coding methods ([`value(forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/value(forKey:)) and [`takeValue(_:forKey:)`](/documentation/ObjectiveC/NSObject-swift.class/takeValue(_:forKey:))). The default implementation returns [`YES`](/documentation/ObjectiveC/YES).

Applications should use the `valueForKey:` and `setValue:forKey:` methods instead of `storedValueForKey:` and `takeStoredValue:forKey:`.

---

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)