0
我遇到了的常見錯誤致命錯誤:意外地發現零,同時展開可選值(lldb)。我已經研究過其他問題,但沒有一個回答我的問題。致命錯誤:在解包可選值(lldb)時意外地發現爲零(lldb)
的錯誤出現在下面的代碼四號線:
if content[indexPath.row].urgent == true {
cell.urgentLabel.text = "URGENT"
} else {
cell.urgentLabel.text = ""
}
上的其他問題,說我應該在4號線""
,但我會如何解決這個問題,它仍然顯示沒有文字。
該碼與下面的數組:
var content:[Agenda] = [
Agenda(subject: "Read this article", deadline: "1-2 days", urgent: false),
Agenda(subject: "Respond to this email", deadline: "ASAP", urgent: true),
Agenda(subject: "Add this to diary", deadline: "When at home", urgent: true),
Agenda(subject: "Listen to this song", deadline: "When finished working", urgent: false),
Agenda(subject: "Check out this holiday destination", deadline: "At the weekend", urgent: false),
Agenda(subject: "Download this podcast", deadline: "1-4 days", urgent: false),
Agenda(subject: "Update notes", deadline: "When at home", urgent: true)
]
確認emergencyLabel已正確連接。 – Moritz
@ EricD.Oops!這是問題所在。把它作爲答案,我會接受它。 –
完成。謝謝。 – Moritz