1
我試圖將我的項目更新爲swift 3.0,並且在UnsafeMutablePointer中遇到了問題。無法爲類型'UnsafeMutablePointer'<uint8>'使用類型爲'(UnsafeMuatableRawpointer?)'的參數列表調用初始值設定項'
這裏是我的錯誤
Cannot invoke initializer for type 'UnsafeMutablePointer<uint8>' with an argument list of type '(UnsafeMuatableRawpointer?)'
代碼:
let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)
let src_buff = CVPixelBufferGetBaseAddress(imageBuffer!)
let dataBuffer = UnsafeMutablePointer<UInt8>(src_buff) //error here
爲什麼呢?如何解決它?
thx !!!有效! –