我为我的线程声明了一个属性:
let loggingThread = Thread.init(target: self, selector: Selector(("loggingThreadProcess:")), object: nil)
@objc func loggingThreadProcess(object: AnyObject?) {
}
但是我收到了这个错误:
[NSThread initWithTarget:selector:object:]:target未实现 selector(*** - [_ SwiftValue loggingThreadProcess:])
有什么建议吗?
答案 0 :(得分:1)
您应该将其定义为:
let loggingThread = Thread.init(target: self, selector: #selector(loggingThreadProcess:), object: nil)