---
title: getLastObject
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osarray/getlastobject
---

# getLastObject

Returns the last member of the array.

## Declaration

```occ
OSObject * getLastObject() const;
```

## Return Value

Return Value Member at the last index or NULL if array has no members.

## Discussion

Discussion If the array has non-zero count the member at the last index is returned, with no additional retain count (the caller should not release). Otherwise NULL.

## See Also

### Accessing Elements

- [getObject](driverkit/osarray/getobject.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)
