我对使用 Swift 很陌生并且有一个问题:我的 WatchKit 应用程序中有两个类。
第一类:
func setScore(inputScore: Int) {
scoreLabel.setText(String(inputScore))
}
... 和 Class 2 应该可以访问这个函数:
var countNumber = 0
...
self.presentControllerWithName("scorePage", context: self)
scorePage.setScore(countNumber)
但我总是得到一个错误:cannot invoke 'setScore' with an argument list of type '(Int)'
我不知道如何解决这个问题,如果有人可以帮助我,那就太好了:)谢谢