Silversnail
Silversnail

Reputation: 386

Pass data back from DetailedView of 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!

Upvotes: 0

Views: 394

Answers (1)

Simon Lee
Simon Lee

Reputation: 22334

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

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

Upvotes: 1

Related Questions