---
title: "CFArrayGetLastIndexOfValue(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfarraygetlastindexofvalue(_:_:_:)"
---

# CFArrayGetLastIndexOfValue(_:_:_:)

Searches an array backward for a value.

## Declaration

```swift
func CFArrayGetLastIndexOfValue(_ theArray: CFArray!, _ range: CFRange, _ value: UnsafeRawPointer!) -> CFIndex
```

## Parameters

- `theArray`: The array to examine.
- `range`: The range within theArray to search. The range must not exceed the bounds of theArray. The range may be empty (length 0). The search progresses from the highest index defined by the range to the lowest.
- `value`: The value for which to find a match in theArray. The equal callback provided when theArray was created is used to compare. If the equal callback was NULL, pointer equality (in C, ==) is used. If value, or any other value in theArray, is not understood by the equal callback, the behavior is undefined.

## Return Value

Return Value The highest index of the matching values in the range, or -1 if no value in the range matched.

## See Also

### Examining an Array

- [CFArrayBSearchValues(_:_:_:_:_:)](corefoundation/cfarraybsearchvalues(_:_:_:_:_:).md)
- [CFArrayContainsValue(_:_:_:)](corefoundation/cfarraycontainsvalue(_:_:_:).md)
- [CFArrayGetCount(_:)](corefoundation/cfarraygetcount(_:).md)
- [CFArrayGetCountOfValue(_:_:_:)](corefoundation/cfarraygetcountofvalue(_:_:_:).md)
- [CFArrayGetFirstIndexOfValue(_:_:_:)](corefoundation/cfarraygetfirstindexofvalue(_:_:_:).md)
- [CFArrayGetValues(_:_:_:)](corefoundation/cfarraygetvalues(_:_:_:).md)
- [CFArrayGetValueAtIndex(_:_:)](corefoundation/cfarraygetvalueatindex(_:_:).md)
