---
title: "removeObserver(_:fromObjectsAt:forKeyPath:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsarray/removeobserver(_:fromobjectsat:forkeypath:)"
---

# removeObserver(_:fromObjectsAt:forKeyPath:)

Removes anObserver from all key value observer notifications associated with the specified keyPath relative to the array’s objects at indexes.

## Declaration

```swift
func removeObserver(_ observer: NSObject, fromObjectsAt indexes: IndexSet, forKeyPath keyPath: String)
```

## Parameters

- `observer`: The observer.
- `indexes`: The index set.
- `keyPath`: The key path, relative to the array, to be observed.

## Discussion

Discussion This is not merely a convenience method; invoking this method is potentially much faster than repeatedly invoking removeObserver(_:forKeyPath:).

## See Also

### Key-Value Observing

- [addObserver(_:forKeyPath:options:context:)](foundation/nsarray/addobserver(_:forkeypath:options:context:).md)
- [removeObserver(_:forKeyPath:)](foundation/nsarray/removeobserver(_:forkeypath:).md)
- [removeObserver(_:forKeyPath:context:)](foundation/nsarray/removeobserver(_:forkeypath:context:).md)
- [removeObserver(_:fromObjectsAt:forKeyPath:context:)](foundation/nsarray/removeobserver(_:fromobjectsat:forkeypath:context:).md)
- [addObserver(_:toObjectsAt:forKeyPath:options:context:)](foundation/nsarray/addobserver(_:toobjectsat:forkeypath:options:context:).md)
