I start getting exception errors on the second line, even though I'm passing clearly "facebook.com" to it.
let cfhost = CFHostCreateWithName(nil, host as CFString).takeRetainedValue()
let status = CFHostStartInfoResolution(cfhost, .addresses, &streamError)
takeRetainedValue is saying that I'm responsible for keeping that string variable in scope. But that value could be getting deallocated while it's still being used, when the app goes in background mode for example.
It could be nil by the time it gets to line two. The solution could be maybe to hold onto it as a class variable instead.
I start getting exception errors on the second line, even though I'm passing clearly "facebook.com" to it.
takeRetainedValue is saying that I'm responsible for keeping that string variable in scope. But that value could be getting deallocated while it's still being used, when the app goes in background mode for example.
It could be nil by the time it gets to line two. The solution could be maybe to hold onto it as a class variable instead.