我是第一次接触swift/ios编程,也不熟悉hackingwithswift.org教程。我要特别尝试change the initial view controller to a table view
我面临的问题是,我不知道如何将初始视图控制器更改为表视图。我尝试将现有的ViewController复制到新的WebViewController中,并从以下位置更新现有的swift文件:
class ViewController: UIViewController, WKNavigationDelegate {
...至:
class ViewController: UITableViewController {
...使用所需的方法,但当我运行模拟器时,它崩溃了:
terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: '-[UITableViewController loadView] loaded the "BYZ-38-t0r-view-8bC-Xf-vdC"
nib but didn't get a UITableView.'
terminating with uncaught exception of type NSException我想我需要在故事板中更新一些东西,但我迷失了什么或如何更新。
我使用的是xcode 12
这个通用的工作流程让我很困惑,我也非常感谢任何文档/书籍的链接,以帮助那些只有很少的移动端接触的全栈开发人员
发布于 2021-01-08 06:03:50
如果在代码中将基类从UIViewController更改为UITableViewController,则必须在IB中拖动一个表模板,而不是通常的VC
https://stackoverflow.com/questions/65620569
复制相似问题