我在編寫segue內部編寫swift代碼時遇到了問題。我編寫的代碼只是爲了將我的文本框內的文字轉換爲另一個視圖上的標籤,但是當我轉到其他頁面時,這會崩潰。在prepareforsegue中更改標籤
var motionMovement : SecondViewController = segue.destinationViewController as SecondViewController
motionMovement.laBel.text = teXt.text
然後我說添加了這個不讓它崩潰
if segue.identifier == "hi"{
var motionMovement : SecondViewController = segue.destinationViewController as SecondViewController
motionMovement.laBel.text = teXt.text
}
但現在不會更改標籤。
它在哪裏崩潰的另一頁?什麼行代碼? – 2015-04-03 00:53:47