1

Is CFunctionPointer supported in Xcode6?I am trying to run following code

class Queue {

    var desc : AudioStreamBasicDescription
    var queue : AudioQueue?
    init(){}
    func audioQueueHandleBuffer(ctx : UnsafeMutablePointer<()>,
        inAQ : AudioQueue!,
        inBuffer : AudioQueueBufferRef) -> Void{

    }

    func initialize() {
        // this does not work!
        var err = AudioQueueNewOutput(&desc, audioQueueHandleBuffer,   //getting error
            nil, nil, nil, 0, queue)


    }
}

But i am getting error.In previous version release note it is explicitly mention that CFunctionPointer is not available.But in Xcode6.1 release notes it is not mention.

How to pass callback in pure swift project.Is there any other way to get buffer in swift?

codester
  • 36,891
  • 10
  • 74
  • 72
  • 2
    You can't treat Swift closures and functions as C function pointers. see http://stackoverflow.com/questions/25341632/pass-c-function-callback-in-swift/26208416#26208416 – CodaFi Oct 06 '14 at 00:01

0 Answers0