转换为 Swift 3 我得到编译器错误:
无法使用类型为“(UnsafeMutableRawPointer?)”的参数列表调用类型“UnsafeMutablePointer”的初始化程序
尝试从不透明指针创建类型化指针时:
let imageRef = myUIImage.cgImage!
let context = CGContext(...)!
let rect = CGRect(...)
context.draw(imageref, in: rect)
var data = context.data
var dataType = UnsafeMutablePointer<UInt8>(data) //Throws the error
为什么这不起作用?