传递主数据和细节之间的值 [英] Pass values between master and detail

查看:117
本文介绍了传递主数据和细节之间的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于传递主数据和细节之间的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆