In Swift, to get a null, I used UnsafeMutablePointer.null() but this did not work. Xcode says it is unavailable and I should use nil literal instead which gives me another error message. Do you have a fix?
Thanks.
In Swift, to get a null, I used UnsafeMutablePointer.null() but this did not work. Xcode says it is unavailable and I should use nil literal instead which gives me another error message. Do you have a fix?
Thanks.
I stumbled upon this post while trying to answer this question myself, and I found that this worked for me
let nullPtr = UnsafeMutablePointer<Int>(nil) // nil is the null pointer var nullPtr: UnsafeMutablePointer<Int>? = nil or simply passing nil as the parameter where an UnsafeMutablePointer<Int>? is expected based on documentation.