---
title: getNextIndexOfObject
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osarray/getnextindexofobject
---

# getNextIndexOfObject

Searches the array for an object.

## Declaration

```occ
uint32_t getNextIndexOfObject(const OSMetaClassBase *anObject, uint32_t index) const;
```

## Parameters

- `anObject`: The object to search for.
- `index`: Zero based index less than the array count to begin the search.

## Return Value

Return Value Index at which the object was found, or -1U if the member was not found in the array after the index parameter.

## Discussion

Discussion Beginning at the passed index, iterate the array until the object instance is found or there are no more members. The search is done by pointer equality.

## See Also

### Accessing Elements

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