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

# getLastObject

The last object in the ordered set if there is one, otherwise NULL.

## Declaration

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

## Discussion

Discussion The returned object will be released if removed from the ordered set; if you plan to store the reference, you should call retain on that object.
