Following Swift3, I'm getting an error on UnsafePointer
. The debugger's proposed solution is not really clear enough to do something with though.
I know UnsafePointer
has been raised in a previous question Issue with UnsafePointer in SQLite project in Swift but I'm struggling to relate its answers to this problem.
Error:
'init' is unavailable: use 'withMemoryRebound(to:capacity:_)' to temporarily view memory as another layout-compatible type.
Code:
let defaultRouteReachability = withUnsafePointer(to: &zeroAddress) {
SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0))
}
Does anyone know how to fix it?