2016-10-06 15 views
0

私は3つのタブを持つアプリケーションを作成しようとしています。タブを変更するとWebビューでタブ付きアプリケーションがクラッシュしますか?

2016-10-06 23:17:54.565932 Techaway[6827:2354958] Unknown class ThirdViewController in Interface Builder file. 
2016-10-06 23:17:59.520639 Techaway[6827:2354958] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Techaway.SecondViewController 0x100f0bc20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Home.' 

それはであれば完璧に動作します:私は拳以外の異なるタブのいずれか、上のWebビューを実行しようとすると、私はViewControllersすべてのセットアップと作業を持っている、しかし、それはこのようなメッセージでクラッシュ最初のViewController、それは私を混乱させる。 SecondViewControllerのコードの

例:

import UIKit 

class SecondViewController: UIViewController { 

    var url = URL(string: "https://example.com/")! 

    @IBOutlet weak var webView: UIWebView! 

    @IBAction func home(_ sender: AnyObject) { 
     webView.loadRequest(URLRequest(url: url)) 


} 


override func viewDidLoad() { 
    super.viewDidLoad() 
    // Do any additional setup after loading the view, typically from a nib. 
    webView.loadRequest(URLRequest(url: url)) 
} 

override func didReceiveMemoryWarning() { 
    super.didReceiveMemoryWarning() 
    // Dispose of any resources that can be recreated. 
} 

}それが一つの場所ではなく、他の作品、なぜ私は理解していない

答えて

関連する問題