传递主数据和细节之间的值

编程入门 行业动态 更新时间:2024-10-25 06:24:26
本文介绍了传递主数据和细节之间的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您认为哪种方法可以在拆分视图的两端之间传递数据?您认为从主人到详细信息或从细节到主人调用方法的最佳方法是哪种?协议?塞格斯?或者......?

Which do you think the best way to pass data between the two sides of a split view? Which do you think the best way to call a method from master to detail or from detail to master? Protocols? Segues? Or...?

我在这个主题中看到过似乎是教程,但我无法弄清楚它最简单的方法。

I have seen seem tutorials in this topic but I can not figure out what is the most trivial way of it.

推荐答案

如果你需要将它们用于多个 UIViewControllers ,协议是最好的方法。虽然如果您需要在两个控制器之间进行显式通信,请尝试在它们之间存储弱引用以调用方法。

Protocols are the best way if you need to use them for multiple UIViewControllers. Though if you need to explicitly communicate between two controllers, try simply storing a weak reference between them to call methods.

更多推荐

传递主数据和细节之间的值

本文发布于:2023-11-23 01:44:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619657.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:细节   数据

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!