[NSNetService _internalNetService]: unrecognized selector sent to instance

URLSession streamTask with NetService crashes in iOS 14 beta.

Code Block swift
func netService(_ sender: NetService, didUpdateTXTRecord data: Data) {
let session = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
let streamTask = session.streamTask(with: sender)
streamTask.resume()
streamTask.captureStreams()
}


Code Block language
-[NSNetService _internalNetService]: unrecognized selector sent to instance 0x600001ed5c40
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNetService _internalNetService]: unrecognized selector sent to instance 0x600001ed5c40'

but this one works fine:

Code Block swift
let streamTask = session.streamTask(withHostName: sender.hostName!, port: sender.port)



FB8026131
[NSNetService _internalNetService]: unrecognized selector sent to instance
 
 
Q