I have a navigation controller with a root view controller (UITableViewController). This table view controller has a modal segue to another navigation controller with a UITableViewController as the root view controller. From my modal table view controller, I am calling
[self dismissModalViewControllerAnimated:YES];
to dismiss the model view. I am trying to, prior to dismissing the modal view, call my "refresh" function (which is located in the first UITableViewController). I tried using
[self.parentViewController refresh];
but I am guessing that I am then referring to the navigation controller of the modal view? It doesn't seem to be working for that reason.
Create an NSNotificationCenter
in your parent view:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refresh) name:@"updateParent" object:nil];
Then call it when you dismiss the modal view:
[[NSNotificationCenter defaultCenter] postNotificationName:@"updateParent" object:nil];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With