---
title: getObject
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osarray/getobject
---

# getObject

Returns a member of the array.

## Declaration

```occ
OSObject * getObject(uint32_t index) const;
```

## Parameters

- `index`: Zero based index less than the array count to add the object.

## Return Value

Return Value Member at the given index or NULL if the index is greater or equal to the array count. The retain count of the result object is not incremented and the object should not be release by the caller.

## Discussion

Discussion If the index is less than the array count the member at that index is returned, with no additional retain count (the caller should not release). Otherwise NULL.

## See Also

### Accessing Elements

- [getLastObject](driverkit/osarray/getlastobject.md)
- [getNextIndexOfObject](driverkit/osarray/getnextindexofobject.md)
- [setObject](driverkit/osarray/setobject-3bore.md)
- [setObject](driverkit/osarray/setobject-4ys3x.md)
- [iterateObjects](driverkit/osarray/iterateobjects.md)
- [replaceObject](driverkit/osarray/replaceobject.md)
- [removeObject](driverkit/osarray/removeobject.md)
- [OSArrayAppendValue](driverkit/osarrayappendvalue.md)
- [OSArrayReplaceValue](driverkit/osarrayreplacevalue.md)
