ios - 如何将 View Controller 的 socket 链接到另一个 socket ?

标签 ios xcode swift iboutlet

我正在开发一个使用解析的应用程序,所以我使用“入门项目”作为基础并从那里开始工作。

我面临的问题是 ViewController 正在控制登录屏幕以及我后来添加的 tableView 和 mapView 等其他内容。

在这种情况下,如果可能的话,我会通过简单地从代码拖动到 map 来链接 map 导出,但显然这是不可能的,我该如何解决这个问题(我知道我可能正在查看以错误的方式提出问题,但我们将不胜感激)

这是带有 map 导出的代码

code

这是布局的样子

this is what the layout looks like

最佳答案

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/

相关文章:

ios - UISearchResultsUpdating w/ReactiveCocoa

ios - URL Scheme 不适用于 native iOS 应用程序

ios - 从 api 检索计数后,在 tableview 委托(delegate)中更新我的 NSMutablearray 计数的最佳方法是什么?

ios - 核心音频 iOS : Retrieving the past & future timestamps for captured & to-be-rendered samples

iOS - 两个应用程序目标,共享应用内购买

swift - 在表格 View 中使用静态单元格时如何执行注销操作?

ios - Swift/NSMutableDisctionary init/如何使值可选

swift - 无法获取新密码以生成强密码和自动填充

Swift - 以编程方式创建的按钮和标签相互链接

swift - 将自定义文档添加到重写函数