Daniela
Daniela

Reputation: 15

Passing Data between two UITableViews

How I can pass datas between two UITableViews? One TableView should have multiple defined rows with check marks (like a setup panel). This checked rows in TableView one should then be visible in the second TableView. Any idea or code example to do this? Thanks.

Upvotes: 0

Views: 43

Answers (3)

RaviM
RaviM

Reputation: 62

Take two tableview in common view controller. Just differentiate it with tag. When you gets the data from parsing simply reload table with tag. You can manage two tableviews in common base view controller.

Upvotes: 0

Gaurav Patel
Gaurav Patel

Reputation: 957

I ended up using this example

Sharing data between view controllers and other objects @ iPhone Dev SDK

Upvotes: 0

Droppy
Droppy

Reputation: 9721

You need to provide common model data (typically an array) and have both tableview datasources use this common model data.

How each datasource presents this data is up to them, and will influence how each table presents the data. If one tableview "edits" the model data, the other tableview can be told to redraw that item in the data array. This works both ways.

This is classic MVC (M = data, V = tableview, C = tableview.datasource).

Upvotes: 1

Related Questions