【问题标题】:scene is unreachable due to a lack of entry points.. no identifier for runtime access?由于缺少入口点,场景无法访问.. 没有运行时访问的标识符?
【发布时间】:2015-06-01 05:27:35
【问题描述】:

这个问题已经被问过并解决过,但我还没有找到解决我的问题的解决方案。为什么我会收到此“由于缺少入口点而无法访问场景并且没有通过 - 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。

标签: ios uitableview swift xcode6


【解决方案1】:

在你的故事板中,确保你的初始视图控制器有一个指向它的箭头。如果没有,请在检查器窗口中检查该视图控制器的“初始视图控制器”。

应用程序找不到初始视图控制器,这就是它的全部抱怨。

【讨论】:

  • 是的,这有效,应用程序相应地运行,但错误仍然存​​在。这是为什么呢?
猜你喜欢
  • 2016-07-06
  • 1970-01-01
  • 2012-11-11
  • 2014-10-11
  • 2016-05-16
  • 1970-01-01
  • 2015-10-18
  • 1970-01-01
  • 2012-04-02
相关资源
最近更新 更多