0
我有一個alertController
其中button
。以下是我創建的button
:更改按鈕名稱
var myButton : UIAlertAction!
// Later...
self.myButton = UIAlertAction(title: "myButton", style: .Default, handler: {action -> Void in
self.myButton.title = "✔︎\(myButton)"
})
後按鈕獲取的選擇,我想在標題前加上一個「✔︎」。 (你可以在上面的代碼中的最後一行看到的。)當我嘗試這樣做,我得到以下錯誤:
Cannot assign to the result of this expression
我能做些什麼來解決這個問題?如果myButtons
標題是read-only
,那麼是否有有效的解決方法?