0

I've a master detail project, when I click on a cell in the master I can see the detail with the number of row with this code in the prepareForSegue:

DetailViewController *controller = (DetailViewController *)[[segue destinationViewController] topViewController];
[controller setDetailItem:indexPath.row];

Now in the detail I have a button too, when I click I want to remove the cell at the master's index saved in the detailItem of DetailViewController.

How can I do this?

Thanks.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
XRay
  • 25
  • 4
  • On "Remove" button press, remove the object from the master's array and navigate or pop the detailVC and reload the master's table data. – Anand Kore Jul 19 '18 at 05:49

1 Answers1

1

I guess you can do it by implementing simple delegate pattern, you can find answer here:

How do I set up a simple delegate to communicate between two view controllers? (just in case: Master – root view controller, details - child)