I am trying to set a dynamic NSString value each time a table cell is pressed in my app. I am able to pass the variable to my custom UINavigationController with the code below -
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
NSString *page = [menuItems objectAtIndex:indexPath.row];
[[segue destinationViewController] setGrabPage: page];
}
The problem is that grabPage
only gets set in the NavigationController, and not the top view displayed within the navigation controller. How do I pass this value through to the top view?