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

# accessInstanceVariablesDirectly

Returns a Boolean value that indicates whether the key-value coding methods should access the corresponding instance variable directly on finding no accessor method for a property.

```
class var accessInstanceVariablesDirectly: Bool { get }
```

## Return Value

[`YES`](/documentation/ObjectiveC/YES) if the key-value coding methods should access the corresponding instance variable directly on finding no accessor method for a property, otherwise [`NO`](/documentation/ObjectiveC/NO).

## Discussion

The default returns [`YES`](/documentation/ObjectiveC/YES). Subclasses can override it to return [`NO`](/documentation/ObjectiveC/NO), in which case the key-value coding methods won’t access instance variables.

---

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)