Selector

在Swift4中,

self.timer = Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(self.updateTimer), userInfo: nil, repeats: true)

Warnning:Argument of '#selector' refers to instance method 'updateTimer()' that is not exposed to Objective-C  

              Add '@objc' to expose this instance method to Objective-C

 

处理方法:

@objc func updateTimer() {

    // ...

}

posted @ 2018-06-04 16:24  象棋中的象棋  阅读(178)  评论(0编辑  收藏  举报