我有一个带有UIPicker的iOS Watch应用程序,我不断收到与之相关的日志,我无法确定与Watch应用程序有关:
[default] -[SPRemoteInterface handlePlistDictionary:fromIdentifier:]:2977: ComF:->Plugin method .pickerFocus is not implemented by the controller (null)
[default] -[SPRemoteInterface handlePlistDictionary:fromIdentifier:]:2977: ComF:->Plugin method .pickerClearFocus is not implemented by the controller (null)
我检查了文档,最接近我找到的只是pickerDidFocus()方法,这似乎在谈论我正在使用的一般问题领域,但没有明确的实现方法,特别是.pickerClearFocus和.pickerFocus.
解决方法
我找到了一个解决方案(WKInterfaceButton).按钮参考插座和按钮发送的动作插座必须在同一个类中.当选择器插口引用视图并且操作引用视图控制器时,会显示该消息.
细胞 :
class aCellView: NSObject {
var delegate: WKInterfaceController? = nil
// The action outlet
@IBAction func doSomeThing() {
self.delegate!.doSomeThing()
}
}
控制器:
class HomeInterfaceController: WKInterfaceController {
// ... where you implement your cell
cell.delegate = self
// ... where you implement your cell
}