1

我正在尝试将 Ensembles 记录转发到我的记录器类。但是我在第一次调用 CDELog 时收到 EXC_BAD_ACCESS

设置 CDESetLogCallback 的代码:

    lazy var opaquePointerLogFunc : COpaquePointer = {
                let mutablePointer = UnsafeMutablePointer<(String,CVarArgType...) -> Void>.alloc(1)
                mutablePointer.initialize(myLog)
                let opaquePointer = COpaquePointer(mutablePointer)
                return opaquePointer
            }()


    func myLog(message:String, args : CVarArgType ...){
            println(__FUNCTION__)
            //never gets called
        }

    CDESetLogCallback(self.opaquePointerLogFunc)
4

0 回答 0