<!--
{
  "availability" : [
    "iOS: 4.2.0 -",
    "iPadOS: 4.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMIDI",
  "identifier" : "/documentation/CoreMIDI/MIDIObjectFindByUniqueID(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core MIDI"
    ],
    "preciseIdentifier" : "c:@F@MIDIObjectFindByUniqueID"
  },
  "title" : "MIDIObjectFindByUniqueID(_:_:_:)"
}
-->

# MIDIObjectFindByUniqueID(_:_:_:)

Locates a device, entity, or endpoint by its unique identifier.

```
func MIDIObjectFindByUniqueID(_ inUniqueID: MIDIUniqueID, _ outObject: UnsafeMutablePointer<MIDIObjectRef>?, _ outObjectType: UnsafeMutablePointer<MIDIObjectType>?) -> OSStatus
```

## Parameters

`inUniqueID`

The unique ID of the object to search for. You determine the unique ID by querying [`MIDIObjectGetIntegerProperty(_:_:_:)`](/documentation/CoreMIDI/MIDIObjectGetIntegerProperty(_:_:_:)) for the [`kMIDIPropertyUniqueID`](/documentation/CoreMIDI/kMIDIPropertyUniqueID) property.

`outObject`

The returned object, or 0 if the object wasn’t found or an error occurred. Cast this pointer to the appropriate type, according to type specified by the `outObjectType` argument.

`outObjectType`

On exit, the type of object found, or undefined if the system found no objects.

## Return Value

An `OSStatus` error code, including [`kMIDIObjectNotFound`](/documentation/CoreMIDI/kMIDIObjectNotFound) if there is no object with this unique ID.

## Topics

### Parameter Types

[`MIDIUniqueID`](/documentation/CoreMIDI/MIDIUniqueID)

A MIDI object’s unique identifier.

[`kMIDIInvalidUniqueID`](/documentation/CoreMIDI/kMIDIInvalidUniqueID)

An invalid identifier.

[`MIDIObjectType`](/documentation/CoreMIDI/MIDIObjectType)

The MIDI object types that the system supports.



---

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)