在 Swift3 之后,我在UnsafePointer
. 调试器提出的解决方案还不够清楚,无法做些什么。
我知道在 Swift 的 SQLite 项目中的 UnsafePointerUnsafePointer
问题之前的问题中提出了问题,但我正在努力将其答案与这个问题联系起来。
错误:
'init' is unavailable: use 'withMemoryRebound(to:capacity:_)' to temporarily view memory as another layout-compatible type.
代码:
let defaultRouteReachability = withUnsafePointer(to: &zeroAddress) {
SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0))
}
有谁知道如何修理它?