此問題已被問到&之前解決,但我還沒有找到解決方案,解決了我的問題。爲什麼我得到這個「場景由於缺乏入口點而無法訪問,並且沒有通過」instantiateViewControllerWithIdentifier「錯誤的運行時訪問標識符?當我運行的應用程序,在啓動圖像後,它只是變成黑色&調試器有以下消息:由於缺少入口點,無法訪問場景..運行時訪問沒有標識符?
我的默認TableViewController(這是我的第一個)被實例化用下面的代碼中:
import UIKit
class FirstTableViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Table view data source
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Potentially incomplete method implementation.
// Return the number of sections.
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete method implementation.
// Return the number of rows in the section.
return 21
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell
return cell
}
}
和我的以下兩個tableViewControllers也實例化。什麼似乎是這個問題?
我想你的Storyboard中有另一個場景不能通過segue訪問,也沒有設置標識符。因此,請使用segue連接它或在Identity Inspector中設置一個Storyboard ID。使用ID可以使用instantiateViewControllerWithIdentifier實例化ViewController。 – Pierre