0
當我啓動應用程序,我看到一個白色的屏幕,並告訴我這個錯誤,我該如何解決它?出現在此行中的錯誤:當我啓動應用程序時,我看到一個白色的屏幕,並告訴我這個錯誤,我該如何解決它?
[myLabel.alpha = 0]
錯誤是線程1:EXC_BAD_INSTRUCTION(代碼= EXC_I386_INVOP,subcode0x0)
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
myLabel.alpha = 0
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
你在哪裏聲明瞭myLabel? –
@IBOutlet weak var myLabel:UILabel! 在這一行中,它位於括號內 – Ludo7
您是否檢查過它的輸出是否正確?檢查IBOutlet與接口生成器連接 –