I need to send data to the parent view controller; so (in the parent) I created a method setLocWithName: loc:
to do this. How do I create a object that is the parent controller? I tried parentViewController
as well as presentingViewController
(as shown below) but I'm getting the warning:
Incompatible pointer types initializing 'TDViewController *__strong' with an expression of type 'UIViewController *'
// set object of parent view controller
TDViewController *tDViewController = [[self navigationController] presentingViewController];
// get data
NSArray *locs = [[PLStore sharedStore] allLocs];
PL *setselectedLoc = [locs objectAtIndex:[indexpath row]];
// send data to parent view controller
[tDViewController setLocWithName:[setselectedLoc pLocName] loc:[setselectedLoc loc1]];
// Pop this view controller off the stack
[self.navigationController popViewControllerAnimated:YES];