進口UIKit的,並試圖切換周圍,其中以編程方式初始化按鈕的顏色後,我似乎無法找出爲什麼崩潰發生在類符合WKInterfaceControllerWatchKit的setBackground顏色碰撞
import UIKit
import WatchKit
class InterfaceController: WKInterfaceController {
@IBOutlet fileprivate var myButton : WKInterfaceButton!
override func willActivate() { // About to be visible to user
super.willActivate()
self.myButton.setBackgroundColor(UIColor.red) // CRASH
}
}
你當前的代碼行沒有錯,顯示錯誤信息。 –
@RashwanL只是附加圖片 – lifewithelliott