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

# noteSelectedAlternativeString(_:)

Sent to the `NSTextAlternatives` object by the text view when the user chooses one of the alternative strings.

```
func noteSelectedAlternativeString(_ alternativeString: String)
```

## Parameters

`alternativeString`

The alternative string chosen by the user.

## Discussion

The base class implementation sends a notification, `NSTextAlternativesSelectedAlternativeStringNotification`, with the selected alternative string in the user info under the key `@"NSAlternativeString"`. Using this mechanism, arbitrary objects can listen for user selections of alternative strings.

---

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)