Dismiss ViewController + Table ViewController + Master Detail App

I have a Master-Detail application. Both wizards and details are UITableViewControllers. In the scene details, I created a button and call its action

- (IBAction)completeTaskButtonPressed:(id)sender {
    [[self delegate] removeCompletedTask:self.indexFromRow controller:self];


In Master VC implementation I have a method

- (void) removeCompletedTask:(NSInteger)index controller:(DetailViewController *) controller {
    [self.dataController.masterTasksList removeObjectAtIndex:index];
    [self.tableView reloadData];
    [self dismissViewControllerAnimated:YES completion:NULL];


This method should delete the selected row and return to the main view. The problem is that it removes the line, but DONT rejects the verbose view. Any help would be helpful.


source to share

2 answers

It looks like your master part setup includes a navigation controller. If you want to reject the part submission in the same way as when you clicked the Back button, use [self.navigationController popViewControllerAnimated:YES]




try [self rejectModalViewControllerAnimated: YES]; or you can try:

  [self.navigationController popViewControllerAnimated:YES].


You introduce a view controller, which is the opposite of pushViewController:



All Articles