---
title: markedRange
framework: AppKit
role: symbol
role_heading: Instance Method
platforms: [macOS 10.0+]
path: appkit/nstextinput/markedrange
---

# markedRange

Returns the range of the marked text.

## Declaration

```occ
- (NSRange) markedRange;
```

## Return Value

Return Value The range of marked text.

## Discussion

Discussion The returned range measures from the start of the receiver’s text storage. The return value’s location is NSNotFound, and its length is 0 if and only if hasMarkedText returns false.

## See Also

### Deprecated methods

- [hasMarkedText](appkit/nstextinput/hasmarkedtext.md)
- [selectedRange](appkit/nstextinput/selectedrange.md)
- [setMarkedText:selectedRange:](appkit/nstextinput/setmarkedtext:selectedrange:.md)
- [unmarkText](appkit/nstextinput/unmarktext.md)
- [validAttributesForMarkedText](appkit/nstextinput/validattributesformarkedtext.md)
- [attributedSubstringFromRange:](appkit/nstextinput/attributedsubstringfromrange:.md)
- [insertText:](appkit/nstextinput/inserttext:.md)
- [characterIndexForPoint:](appkit/nstextinput/characterindexforpoint:.md)
- [firstRectForCharacterRange:](appkit/nstextinput/firstrectforcharacterrange:.md)
- [doCommandBySelector:](appkit/nstextinput/docommandbyselector:.md)
- [conversationIdentifier](appkit/nstextinput/conversationidentifier.md)
