如何根据iPhone中tableview的所选行传递firstview值

发布于 2024-12-29 01:51:43 字数 359 浏览 2 评论 0原文

我有 3 个 ViewController,我的 FirstView 是显示从数据库获取的所有数据的位置,而在 SecondView 中我正在数据库中插入新数据。 到目前为止,一切正常

我的问题是,当我单击编辑按钮时,我的FirstView进入编辑模式。 此时,我必须传递 FirstView 上显示的所有值。

如果我选择任何行,那么它会转到我的 ThirdView 这是我的更新视图,我可以在需要时更改值。在我的 ThirdView 中,我有 UITableView,我希望显示与 FirstView 中相同的值

。如何做到这一点,请帮助我。

I have 3 ViewController, my FirstView is where I am showing all data which is fetched from database and in SecondView I am inserting new data in database.
Up to here is working good

My problem when I click on Edit button then my FirstView goes to edit mode.
At this time, I have to pass all values which are displayed on FirstView.

If I select any row then it goes to my ThirdView which is my Update view, where i can change values if needed. In my ThirdView I have UITableView, I want same value to be displayed which are in FirstView

How to do this please help me on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏天碎花小短裙 2025-01-05 01:51:43

您可以将 ThirdView 的表格视图的 dataSource 设置为 FirstView。为此,您需要将 FirstView 的引用发送到 ThirdView

tableView.dataSource = firstViewRefernce;

You can set the dataSource for the ThirdView's table view to the FirstView. For this you need to send the reference of the FirstView to ThirdView.

tableView.dataSource = firstViewRefernce;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文