---
title: "invalidateFoundRange:inDocument:"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitextsearchaggregator-c.protocol/invalidatefoundrange:indocument:"
---

# invalidateFoundRange:inDocument:

Removes a text range from the set of matches.

## Declaration

```occ
- (void) invalidateFoundRange:(UITextRange *) range inDocument:(UITextSearchDocumentIdentifier) document;
```

## Parameters

- `range`: The text range to remove from the set of matches.
- `document`: A string that uniquely identifies the document containing the text range. Nil when searching a single document.

## Discussion

Discussion Call this method to invalidate a text range when removing or changing text in the document. This causes the system find panel to update its current state, and if the range is the highlighted range, the find panel advances to the next found result.

## See Also

### Tracking search results

- [foundRange:forSearchString:inDocument:](uikit/uitextsearchaggregator-c.protocol/foundrange:forsearchstring:indocument:.md)
- [invalidate](uikit/uitextsearchaggregator-c.protocol/invalidate.md)
- [finishedSearching](uikit/uitextsearchaggregator-c.protocol/finishedsearching.md)
- [allFoundRanges](uikit/uitextsearchaggregator-c.protocol/allfoundranges.md)
