IOBluetoothDeviceInquiry::foundDevices incorrectly typed
Hi,
I noticed that in objc2-io-bluetooth, IOBluetoothDeviceInquiry::foundDevices is typed to return a Retained<NSArray> when it should be returning a Retained<NSArray<IOBluetoothDevice>> as stated in the description:
Return Value:
Returns an NSArray of IOBluetoothDevice objects.
I think this is due to the method signature being func foundDevices() -> [Any]!
This in turn makes it impossible to iterate over the NSArray. (At least I think. I'm still quite new to Rust)
Yeah, this is fundamentally a problem in Apple's headers. I've been planning to add functionality to our binding generation tool to handle such cases manually, but haven't gotten around to it yet.
In the meantime, you can still iterate over it, you just need to call obj.downcast::<IOBluetoothDevice>().unwrap() while doing so (just like you'd write obj as! IOBluetoothDevice in Swift).