1
中更新我的xcode以獲得最新的測試版,並且出現了這樣的問題。 之前我的代碼在Objective-C運行良好:如何在一個快速的3
short * pointers = (short *)[[params valueForKey:@"Pointers"] pointerValue];
然後我翻譯的迅速語言代碼的一部分:
let pointers = UnsafeMutablePointer<Int16>(((params["Pointers"] as AnyObject).pointerValue)!)
在這裏,一切都很好。 But this code is not working on the Swift 3。告訴你如何快速實施3.謝謝你!
嘗試鑄造NSValue, '(params [「Pointers」]作爲NSValue).pointerValue' –
@LeoDabus感謝您的答案。錯誤: 「不能調用初始化類型 'UnsafeMutablePointer' 有型 '(UnsafeMutableRawPointer)' –
Feanon
參數列表@LeoDabus讓數據A = unsafeBitCast((PARAMS [」 指針「]作爲NSValue).pointerValue,到:UnsafeMutablePointer .self)。工作!:)。謝謝你的幫助 –
Feanon