Vanya Vanya - 4 months ago 38
Swift Question

Using CFArrayGetValueAtIndex in Swift with UnsafePointer (AUPreset)

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>
.

Answer

Have you tried this?:

    let aPreset = UnsafePointer<AUPreset>(CFArrayGetValueAtIndex(mEQPresetsArray, indexPath.row))
Comments