NSSound instance associated with a given name.
- macOS 10.0+
Name that identifies sound data.
NSSound instance initialized with the sound data identified by
The returned object can be one of the following:
One that’s been assigned a name with the
One of the named system sounds provided by the Application Kit framework
If there’s no known
NSSound object with
sound, this method tries to create one by searching for sound files in the application’s main bundle (see
Bundle for a description of how the bundle’s contents are searched). If no sound file can be located in the application main bundle, the following directories are searched in order:
If no data can be found for
sound, no object is created, and
nil is returned.
The preferred way to locate a sound is to pass a name without the file extension. See the class description for a list of the supported sound file extensions.