---
title: getNextIndexOfObject
framework: Kernel
role: symbol
role_heading: Instance Method
platforms: [driverkit 19.0+, macOS 10.15+]
path: kernel/osarray/3180815-getnextindexofobject
---

# getNextIndexOfObject

Searches the array for an object.

## Declaration

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

```occ
virtual unsigned int getNextIndexOfObject(const OSMetaClassBase *anObject, unsigned int index);
```

## Parameters

- `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](kernel/osarray/3180816-getobject.md)
- [getLastObject](kernel/osarray/3180814-getlastobject.md)
- [setObject](kernel/osarray/3180822-setobject.md)
- [setObject](kernel/osarray/3433840-setobject.md)
- [iterateObjects](driverkit/osarray/iterateobjects.md)
- [replaceObject](kernel/osarray/3180821-replaceobject.md)
- [removeObject](kernel/osarray/3180820-removeobject.md)
