---
title: getAnyObject
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osset/getanyobject
---

# getAnyObject

Returns an arbitrary (not random) object from the set.

## Declaration

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

## Return Value

Return Value An arbitrary (not random) object if one exists within the set.

## Discussion

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