[英](SWIFT2.1) what Expected Expression after operator
我正在開發需要在其中使用表格視圖的應用程序,而我的意思是使用結構和數組在表格視圖之間傳遞數據。 我有一個問題
正如您在上圖“准備進行隔離”之后所看到的那樣,存在一個問題,我花了數天時間試圖解決,但找不到任何解決方案。
所以問題是這個運算符期望什么表達式?
|
不是您要找的東西。 寫:
let destViewController = seque.destinationViewController as! ModelsTableViewController //I made some improvements like let and naming convention
並且您應該使用可選選項來提高代碼安全性:
if let destViewController = seque.destinationViewController as? ModelsTableViewController {
//Now you're sure destViewController is allocated
//Do your stuff here
}
您還應該使用良好的命名約定進行命名。 喜歡(這是一個獎勵):
STHModelsTableViewController
刪除之前的空間! 在第二行
let i: Int? = 1
let j = i !
// Excepted expression after operator
...
let i: Int? = 1
let j = i! // works!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.