我一直在這裏工作大約一個小時。我在這個視線中看到了其他問題,並且嘗試了相同的錯誤,並嘗試瞭解決方案。雖然我仍然收到錯誤。這裏是我的代碼:類沒有初始化器?
class Links: UIViewController {
let firstLinkButton: UIButton?
let secondLinkButton: UIButton?
@IBAction func firstLinkButton(sender: AnyObject) {
UIApplication.sharedApplication().openURL(NSURL(string: "http://www.google.com")!)
}
@IBAction func secondLinkButton(sender: AnyObject) {
UIApplication.sharedApplication().openURL(NSURL(string: "http://www.bing.com")!)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
這可能是對這個景象,但今天最簡單的問題,任何輸入或建議,不勝感激。提前致謝。
P.S .: R.I.P.我的聲譽。
究竟是什麼問題? –
我收到一個錯誤「Class Link has no initializers」。 – Bigfoot11