---
title: "select(withFrame:in:editor:delegate:start:length:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscell/select(withframe:in:editor:delegate:start:length:)"
---

# select(withFrame:in:editor:delegate:start:length:)

Selects the specified text range in the cell’s field editor.

## Declaration

```swift
func select(withFrame rect: NSRect, in controlView: NSView, editor textObj: NSText, delegate: Any?, start selStart: Int, length selLength: Int)
```

## Parameters

- `rect`: The bounding rectangle of the cell.
- `controlView`: The control that manages the cell.
- `textObj`: The field editor to use for editing the cell.
- `delegate`: The object to use as a delegate for the field editor (textObj parameter). This delegate object receives various NSText delegation and notification methods during the course of editing the cell’s contents.
- `selStart`: The start of the text selection.
- `selLength`: The length of the text range.

## Discussion

Discussion This method is similar to edit(withFrame:in:editor:delegate:event:), except that it can be invoked in any situation, not only on a mouse-down event. This method returns without doing anything if controlView, textObj, or the receiver is nil, or if the receiver has no font set for it.

## See Also

### Editing and Selecting Text

- [edit(withFrame:in:editor:delegate:event:)](appkit/nscell/edit(withframe:in:editor:delegate:event:).md)
- [sendsActionOnEndEditing](appkit/nscell/sendsactiononendediting.md)
- [endEditing(_:)](appkit/nscell/endediting(_:).md)
- [wantsNotificationForMarkedText](appkit/nscell/wantsnotificationformarkedtext.md)
- [fieldEditor(for:)](appkit/nscell/fieldeditor(for:).md)
- [usesSingleLineMode](appkit/nscell/usessinglelinemode.md)
