I have an UIView with embedded an UITableView.
One text field in the same view should control the table’s cells number.
If the user enters the number 4, immediately the TableView should change its cells number to reflect what the user entered.
The content of the cells will just be something like “Please select”.
Then, when the user selects a cell, a Date Picker should come up, let the user choose the date/time and then, when the picker is dismissed, that cell should change to the date/time selected.
I’m going crazy with this since more than two days. I don’t put any code here because I really have no idea where to start and all the things I’ve tried so far were a complete failure.
If anyone can lead me to the solution, I would really appreciate it.
Thanks.
If you’re on the iPad, you could show a UIPopOverController from the selected cell when the user selects it. On an iPhone, you could present a modal view controller.
For this, see
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath.You’ll have to implement code that handles getting the value from the UIDatePicker when its presenting view controller is dismissed. Also, you’ll have to host the UIDatePicker in a view controller, as there is no way (as far as I know) to present it on its own.
So, my proposed solution is:
tableView:didSelectRowAtIndexPath:event for your UITableView.[tableView reloadData]to perform this).