My problem is simple, but tricky. I want to write this line
AUPreset *aPreset = (AUPreset*)CFArrayGetValueAtIndex(mEQPresetsArray, indexPath.row);
in Swift. The trick is that the return value is UnsafePointer<Void>
.
My problem is simple, but tricky. I want to write this line
AUPreset *aPreset = (AUPreset*)CFArrayGetValueAtIndex(mEQPresetsArray, indexPath.row);
in Swift. The trick is that the return value is UnsafePointer<Void>
.
Here's the Swift 4 version
let aPreset = unsafeBitCast(CFArrayGetValueAtIndex(mEQPresetsArray, indexPath), to: AUPreset.self)
Have you tried this?:
let aPreset = UnsafePointer<AUPreset>(CFArrayGetValueAtIndex(mEQPresetsArray, indexPath.row))