Tuesday, 6 August 2013

Reload data in programmatically created tableView

Reload data in programmatically created tableView

I have looked at a number of other SO questions related to this question
and have not found one dealing with my specific situation. I create a
variable number of tableViews programmatically in one method. At a later
point, I would like to reload the data in any one of the tableViews in
another method. I would like to use...
[tableView reloadData];
to reload the data in a specific tableView. The problem I am having is
accessing the tableView that was created programmatically at a later
point. My thought is to set a unique tag for each tableView as it is
created.
So here is my question. Is it possible to create and initialize a
tableView by referring to an existing tableView's tag. For instance, with
a UIView it is possible to...
UIView *notATableView = [[UIView alloc] viewWithTag:1];
which would allow me to modify the view whose tag was equal to 1. Does a
similar possibility exist for tableViews?

No comments:

Post a Comment