---
title: "ivar_getOffset(_:)"
framework: Objective-C Runtime
role: symbol
role_heading: Function
platforms: [iOS 2.0+, iPadOS 2.0+, Mac Catalyst 13.1+, macOS 10.5+, tvOS 9.0+, visionOS 1.0+, watchOS 1.0+]
path: "objectivec/ivar_getoffset(_:)"
---

# ivar_getOffset(_:)

Returns the offset of an instance variable.

## Declaration

```swift
func ivar_getOffset(_ v: Ivar) -> Int
```

## Discussion

Discussion For instance variables of type id or other object types, call object_getIvar(_:_:) and object_setIvar(_:_:_:) instead of using this offset to access the instance variable data directly.

## See Also

### Working with Instance Variables

- [ivar_getName(_:)](objectivec/ivar_getname(_:).md)
- [ivar_getTypeEncoding(_:)](objectivec/ivar_gettypeencoding(_:).md)
