ios开发遇到的问题

运行后界面空白,Xcode跳转到APPDelegate.swift文件提示如下

第一种可能原因:

做输出口后在代码中重新命名了输出口

解决方法:

右键控件关闭输出口的连接,变回+号,将它重新连到代码的var...处松开。

或者直接删除代码代码重新做输出口。

第二种可能原因:

修改了ViewController.swift文件的父类的继承

原class CustomCell: UITableViewCell
后class CustomCell: UITableTableViewCell
解决方法:

AppleDelegate文件指定ViewController视图控制器:

self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.backgroundColor = UIColor.white
self.window?.rootViewController = ViewController()
self.window?.makeKeyAndVisible()

猜你喜欢

转载自www.cnblogs.com/editwe/p/9379304.html