diff --git a/src/platform/Darwin/BleConnectionDelegateImpl.mm b/src/platform/Darwin/BleConnectionDelegateImpl.mm index 5afd14fcb89199..ad1093007473bb 100644 --- a/src/platform/Darwin/BleConnectionDelegateImpl.mm +++ b/src/platform/Darwin/BleConnectionDelegateImpl.mm @@ -698,7 +698,7 @@ - (void)removePeripheralFromCache:(CBPeripheral *)peripheral - (void)removePeripheralsFromCache { - for (CBPeripheral * peripheral in _cachedPeripherals) { + for (CBPeripheral * peripheral in [_cachedPeripherals allValues]) { [self removePeripheralFromCache:peripheral]; } }