Timer.scheduledTimer(timeInterval: 5.0, target:self.notificationView, selector: #selector(NotificationView.self.timerFired(_:)), userInfo: nil, repeats: false)
func timerFired(_ timer: Timer) {
print("Timer Fired")
}
***终止应用程序由于未捕获的异常 'NSInvalidArgumentException',原因是: ' - [_ SwiftValue timerFired:]:无法识别的选择发送到实例0x7fc0baf46f60'雨燕3.0:计时器不烧其他目标不是自我
我不明白哪里错了?如果目标是自我,那么一切正常。
也许这:http://stackoverflow.com/questions/39622721/how-initialize-a-timer-inside-a-custom-class-in-swift? –