---
title: getFirstObject
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osorderedset/getfirstobject
---

# getFirstObject

The object at index 0 in the ordered set if there is one, otherwise NULL.

## Declaration

```occ
OSObject * getFirstObject() 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.
