I’m developing on IOS.
My current viewController has to display a tableView on the screen, as well as a a update button.
When user tapped this button, current tableView should be moved to leave the screen to the left and released,
at the same time, a new tableView should be allocced and moved in the screen from the right with some new data.
Note that the 2 table holds diffirent data, so I’m thinking how to implement this.
Now I have 2 ideas:
1st. let my current viewController be the delegate and dataSource of these tables, and the different would be embodied in delegate and dataSource method such as:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
if (_aNewTableView) return 0;
else return [sections count];
}
but question is, these flag parameters belongs to current ViewController and be shared by both old and new tables,
so when I alloc a new tableView preparing to move in the screen,
would it affect the old table or be affected by the old one since then share some same flag parameters?
2nd. customize a tableView, and give them some private methods to configure their data or look separatly,
but I need to overwrite those delegate and dataSource methods.
Further more, the custom tableView’s delegate and dataSource should still be a view Controller,
which means I have to creat a new controller specially for the customized tableView, it seems to make problem more complicated.
And I’m not sure whether I know how to overwrite the tableViewDelegate and tableViewDataSource.
So what should I do to realize this function?
Thanks a lot for concerning and answering!
I’ve done this.
I choosed the 1st method, that is, directly creat a tableView after take care with the current tableView and all the flags the new table need.
then use uianimation to move the 2 tables to where they should be, then release the leaved table and retain the new one.
that’s all.