从 UITableView 的DetailedView 传回数据

发布于 2024-11-14 11:37:52 字数 568 浏览 3 评论 0原文

我的 UITableView 的详细视图中有一个 UITextView。我希望能够添加一些文本,并通过 POST 发送到 Web 服务。如果添加文本,则需要在 UITableView 中显示该单元格的指示符。

当发送 POST 和 viewWillDisapear 时,我将 UITextView 设置为空。

所以我的问题是,是否还在DetailedView 消失之前请求该注释并将其传递回 UITableView 类?

当detailedView消失时如何传回数据?

或者请求查看 UITableView 类中是否有注释?然后也将其传入以从 didSelectRowForIndexPath 中显示它。

基本上,我显示了从 UITableView 类传递的DetailedView 中已有的一些数据。现在将在详细视图中设置一些新数据,这些数据将显示在每个视图不同的同一视图中,并且如果有注释,则在 UITableView 中的该单元格上显示指示符图像。

我意识到这是一个有点模糊的问题,但请尝试一下,也许有人可以通过一些参考教程来为我指明正确的方向,该教程用于在单元格中来回传递数据及其详细视图。

提前致谢!

I have a UITextView in a DetailedView of my UITableView. I want to be able to add some text, which is sent to a webservice with POST. If text is added it needs to show an indicator for that cell in the UITableView.

When the POST is sent and viewWillDisapear I set the UITextView to empty.

So my question is if also request that comment before the detailedView disapears and pass it back to the UITableView class?

And how can I pass back the data when the detailedView disapears?

Or do request the to see if there is a comment from the UITableView class? And then also pass it in to display it from didSelectRowForIndexPath.

Basically I display some data already in the DetailedView which is passed from the UITableView class. And now wont to set some new data in the detailedView which will be displayed in the same view different for each view, and show an indicator image on that cell in the UITableView if there is a comment.

I realize it´s a bit vague question but give it shoot, perhaps somebody can point me in the right direction with som reference to a tutorial for passing data back and forth off a cell and it´s detailedView.

Thanks in advance!

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

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

发布评论

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

评论(1

笑忘罢 2024-11-21 11:37:52

在视图控制器之间传递数据最好通过使用委托来实现。

请参阅这篇有关协议和委托的文章... 教程

Passing data between view controllers is best achieved by using delegates.

See this article on protocols and delegates.... tutorial

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