我正在开发一个使用解析的应用程序,所以我使用“入门项目”作为基础并从那里开始工作。
我面临的问题是 ViewController 正在控制登录屏幕以及我后来添加的 tableView 和 mapView 等其他内容。
在这种情况下,如果可能的话,我会通过简单地从代码拖动到 map 来链接 map 导出,但显然这是不可能的,我该如何解决这个问题(我知道我可能正在查看以错误的方式提出问题,但我们将不胜感激)
这是带有 map 导出的代码
这是布局的样子
最佳答案
The MVC model, Model-View-Controller model, isn't intended to have an action in one view touch the controller of another view. In InterfaceBuilder, you should only ever be able to attach actions to the controller for that specific view.
In general, if you set the file owner to
ViewController
, then you can only link IBoutlets to that view controller not make to another one.
您的 map 在您的 MapViewController
中可用,而不是在 ViewController
中,因此您需要提供引用/ map 的 IBoutlet 需要分配 MapViewController
,如果要在ViewController
中实现,需要新建一张图
关于ios - 如何将 View Controller 的 socket 链接到另一个 socket ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34990203/