<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/object_getInstanceVariable",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:@F@object_getInstanceVariable"
  },
  "title" : "object_getInstanceVariable"
}
-->

# object_getInstanceVariable

Obtains the value of an instance variable of a class instance.

```
extern Ivarobject_getInstanceVariable(id obj, const char *name, void **outValue);
```

## Parameters

`obj`

A pointer to an instance of a class. Pass the object containing the instance variable whose value you wish to obtain.

`name`

A C string. Pass the name of the instance variable whose value you wish to obtain.

`outValue`

On return, contains a pointer to the value of the instance variable.

## Return Value

A pointer to the [`Ivar`](/documentation/ObjectiveC/Ivar) data structure that defines the type and name of the instance variable specified by `name`.

## Discussion

---

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)