I have a TableViewController that can be transitioned to from two other view controllers; one transitions by segue, and the other programmatically. Everything works well when transitioning via segue, but when the TableViewController appears after a programmatic transition, the UIBarButtonItem is missing and the cell segue doesn’t work (it should take the user to a new screen).
I’m guessing that because the UIBarButtonItem and cell segue were setup in the Storyboard, they aren’t loaded when the TableViewController is loaded programmatically. So, I’m assuming that I need to load them manually somewhere. My question is where the appropriate place to do this is?
Thanks for reading.
EDIT:
Here’s the code for the transition:
OtherTVC *otherTVC=[[OtherTVC alloc] init];
[self.navigationController pushViewController:otherTVC animated:YES];
This is linked to the callout accessory of a map pin.
To get an instance of the controller as it was created in the storyboard, try giving it an identifier and using
instantiateViewControllerWithIdentifier:rather than thealloc/initroute. If your current controller where the code is running came from the same storyboard, you can get a reference to it through the controller’sstoryboardproperty in order to make that call.