I want that on each page the table will appear. The table will be of the same structure but with the different data on each page. I want that the UIPageControl visualize the current page. How to do it? Using UITableviewController I will be able to update the data in the tables. UITableview has the parameter: paging enable.
I would check the value of the uipagecontrol in cellForRow ... to return the cell at the given page. The uipageControl has a callback on event UIControlEventValueChanged where you should then reload the table view.
- (void) callback:(id) sender {
[mytableview reloadData];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (pgcontrol.currentpage == 1) {
...
} else if (pgcontrol.currentpage == 2) {
....
}
....
}
You then need to carefully place the uipagecontrol on top of the uitbaleview, by experience the best is to have a bacground uiview that contains both a uitableview and a uipagecontrol or other control so that both do not overlap, in which case you end up using a uiviewcontroller instead of a uitableviewcontroller. In general I find that uitableviewcontroller are only useful for plain simple view with just a tableview and no refinement.
Hope this helps.
EDIT : to put it all together you'd go along those lines : 1) create a uiviewcontroller subclass from the file template library 2) on the xib add a page control as a subview of the controller's view, same with adding a uitbaleview 3) you need outlets to those 2 controls and you need to define the controller as data source and delegate for the table 4) you need an IBAction as well to link to the event value changed on the pagecontrol, this is what I name callback:(id) sender in my initial answer + it's IBAction if you do it with IB 5) the rest comes back to the initial answer, with pgcontrol being your outlet to the uipagecontrol