我决定用Swift继续我剩下的项目。当我将自定义类(子类UIViewcontroller)添加到我的storyboard视图控制器并加载项目时,应用程序突然崩溃并出现以下错误:
致命错误:在课堂上使用未实现的初始化程序'init(coder :)'
这是一个代码:
import UIKit
class TestViewController: UIViewController {
init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
// Custom initialization
}
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.
}
/*
// #pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue?, sender: AnyObject?) {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
}
请提出建议
湖上湖
慕妹3146593
ITMISS
相关分类