---
title: "MIDIDeviceListGetNumberOfDevices(_:)"
framework: coremidi
role: symbol
role_heading: Function
path: "coremidi/mididevicelistgetnumberofdevices(_:)"
---

# MIDIDeviceListGetNumberOfDevices(_:)

Retrieves the number of devices in a device list.

## Declaration

```swift
func MIDIDeviceListGetNumberOfDevices(_ devList: MIDIDeviceListRef) -> Int
```

## Parameters

- `devList`: The device list.

## Return Value

Return Value The number of devices in the list, or 0 if an error occurred.

## See Also

### Managing Device Lists

- [MIDIDeviceListGetDevice(_:_:)](coremidi/mididevicelistgetdevice(_:_:).md)
- [MIDIDeviceListAddDevice(_:_:)](coremidi/mididevicelistadddevice(_:_:).md)
- [MIDIDeviceListDispose(_:)](coremidi/mididevicelistdispose(_:).md)
- [MIDIDeviceListRef](coremidi/mididevicelistref.md)
