0
當我試圖創建一個CFDictionary數組時,我收到一個錯誤(如下圖所示)。Swift 3 - 試圖將字典投射到CFDictionary
這是代碼:
let attrs = [kCVPixelBufferCGImageCompatibilityKey:kCFBooleanTrue, kCVPixelBufferCGBitmapContextCompatibilityKey:kCFBooleanTrue] as CFDictionary
但奇怪的是,我使用的另一個項目代碼在同一行,沒有收到任何錯誤。錯誤是什麼意思?
Error: Contextual type 'CFDictionary' cannot be used with dictionary literal
這是否幫助提https://stackoverflow.com/a/33246642/1187415? –