<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCell/setUpFieldEditorAttributes(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCell(im)setUpFieldEditorAttributes:"
  },
  "title" : "setUpFieldEditorAttributes(_:)"
}
-->

# setUpFieldEditorAttributes(_:)

Configures the textual and background attributes of the receiver’s field editor.

```
func setUpFieldEditorAttributes(_ textObj: NSText) -> NSText
```

## Parameters

`textObj`

The field editor to configure.

## Return Value

The configured field editor.

## Discussion

If the receiver is disabled, this method sets the text color to dark gray; otherwise the method sets it to the default color. If the receiver has a bezeled border, this method sets the background to the default color for text backgrounds; otherwise, the method sets it to the color of the receiver’s `NSControl` object.

You should not use this method to substitute a new field editor. [`setUpFieldEditorAttributes(_:)`](/documentation/AppKit/NSCell/setUpFieldEditorAttributes(_:)) is intended to modify the attributes of the text object (that is, the field editor) passed into it and return that text object. If you want to substitute your own field editor, use the [`fieldEditor(_:for:)`](/documentation/AppKit/NSWindow/fieldEditor(_:for:)) method or the [`windowWillReturnFieldEditor(_:to:)`](/documentation/AppKit/NSWindowDelegate/windowWillReturnFieldEditor(_:to:)) delegate method of `NSWindow`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)