<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSpellChecker/menu(for:string:options:atLocation:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSpellChecker(im)menuForResult:string:options:atLocation:inView:"
  },
  "title" : "menu(for:string:options:atLocation:in:)"
}
-->

# menu(for:string:options:atLocation:in:)

Provides a menu containing contextual menu items suitable for certain kinds of detected results.

```
func menu(for result: NSTextCheckingResult, string checkedString: String, options: [NSSpellChecker.OptionKey : Any]? = nil, atLocation location: NSPoint, in view: NSView) -> NSMenu?
```

## Parameters

`result`

The <doc://com.apple.documentation/documentation/Foundation/NSTextCheckingResult> instance for the checked string.

`checkedString`

The string that has been checked.

`options`

The options dictionary allows clients to pass in information associated with the document. See `Spell Checking Option Dictionary Keys` for possible key-value pairs.

`location`

The location, in the view’s coordinate system, to display the menu.

`view`

The view object over which to display the contextual menu.

## Return Value

A menu suitable for displaying as a contextual menu, or adding to another contextual menu as a submenu.

## Discussion

---

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)