【发布时间】:2020-07-25 23:44:28
【问题描述】:
我的视图已连接到我的 ViewContoller swift 文件,文件所有者没问题,但它对我不起作用。视图没有出现,它们是零。我上传了一些图片以获取更多信息。我什么都试过了。清理项目,重新加载 xcode,删除交付的数据,删除 emualtor 数据。
【问题讨论】:
-
你如何加载、初始化你的 ViewController?您需要从 StoryBoard 加载它。让 vc = UIStoryboard(name: "MyStoryBoardName", bundle: nil).instantiateViewController(withIdentifier: "MyViewControllerName") 作为? UIViewController
-
我用导航控制器加载它。 self.navigationController.pushViewController(screen, animated: animated) 加载所有其他视图。我在星期五之后创建的哪些文件不起作用。
-
我理解正确吗? Test3View.xib 是 UIViewController 吗?它拥有视图 viwka?在你的回答中 navigationController.pushViewController(screen, animated: animated) "screen" is Test3View.xib?
-
Test3.swift 是 viewController,screen 是 viewController 类。
-
@HeyJoe - 有多种不同的方法来使用 xib 文件以及如何加载和使用它们。您需要提供有关您正在做什么的更多信息。查看How to Ask 和minimal reproducible example。
标签: ios swift xcode xib viewcontroller