我在swift2中有这段代码
private var RecordedDurationContext = UnsafeMutablePointer<Void>.alloc(1)
如何转换为swift3
答案 0 :(得分:0)
private var RecordedDurationContext = UnsafeMutableRawPointer.alloc(1)
let a = UnsafeMutablePointer<Int>.allocate(capacity: 1)
a.pointee = 42
print("a's value: \(a.pointee)") // 42
a.deallocate(capacity: 1)