<!--
{
  "availability" : [
    "macCatalyst: 14.0.0 -",
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "IOUSBHost",
  "identifier" : "/documentation/IOUSBHost/IOUSBGetNextAssociatedDescriptorWithType(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "IOUSBHost"
    ],
    "preciseIdentifier" : "c:@F@IOUSBGetNextAssociatedDescriptorWithType"
  },
  "title" : "IOUSBGetNextAssociatedDescriptorWithType(_:_:_:_:)"
}
-->

# IOUSBGetNextAssociatedDescriptorWithType(_:_:_:_:)

Obtains the next associated descriptor in a configuration descriptor and matches the type.

```
func IOUSBGetNextAssociatedDescriptorWithType(_ configurationDescriptor: UnsafePointer<IOUSBConfigurationDescriptor>!, _ parentDescriptor: UnsafePointer<IOUSBDescriptorHeader>!, _ currentDescriptor: UnsafePointer<IOUSBDescriptorHeader>!, _ type: UInt8) -> UnsafePointer<IOUSBDescriptorHeader>!
```

## Parameters

`configurationDescriptor`

A configuration descriptor that contains the descriptors to iterate through.

`parentDescriptor`

A descriptor pointer within the bounds of `configurationDescriptor`.

`currentDescriptor`

A descriptor pointer within the bounds of `configurationDescriptor`, or `nil`.

`type`

The descriptor type to find.

## Return Value

A descriptor pointer, or `nil` if no matching descriptor returns.

## Discussion

This method uses [`IOUSBGetNextAssociatedDescriptor(_:_:_:)`](/documentation/IOUSBHost/IOUSBGetNextAssociatedDescriptor(_:_:_:)), and further validates that the returned descriptor’s `bDescriptorType` field matches the type that the parameter passes.

---

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)