I am getting a headache due to UnsafePointer in Swift.
This is the method I want to call:
func CFDictionaryGetValue(theDict: CFDictionary!, _ key: UnsafePointer<Void>) -> UnsafePointer<Void>
And this is how I do it.
let ds: SCDynamicStoreRef = SCDynamicStoreCreate(nil, "setNet" as CFString, nil, nil)!
let list = SCDynamicStoreCopyProxies(ds)
print(list!)
print(CFDictionaryGetValue(list, UnsafePointer("HTTPPort")))
This however returns an error. I have no idea how to pass dictionary key to this method. If I remove the UnsafePointer("HTTPPort")
and use "HTTPPort"
instead I get a runtime error."
How can you access the dictionary values?