Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>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.</p> <p>For this, see <code>-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath</code>.</p> <p>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.</p> <p>So, my proposed solution is:</p> <ol> <li>Create a new view controller that hosts the UIDatePicker you want to present.</li> <li>On that view controller, put "OK" and "Cancel" buttons.</li> <li>Add a property to that view controller that references your "main" view controller. This is so that the view controller that hosts the UIDatePicker can send a message to the "main" view controller when you're done selecting the date.</li> <li>In your "main" view controller, handle the <code>tableView:didSelectRowAtIndexPath:</code> event for your UITableView.</li> <li>Present the view controller to show the UIDatePicker to the user.</li> <li>If the user selects "OK", dismiss the modal/popOver view controller and update the cell with the new information (you'll probably need an array of NSDate values and a call to <code>[tableView reloadData]</code> to perform this).</li> <li>If the user selects "Cancel", dismiss the modal/popOver view controller and DON'T UPDATE ANYTHING.</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload