I am driving myself crazy over what I am sure is a basic error but I just can’t find it. I have simple delegates and everything works except this one. I can’t see any difference from the way I normally handle things.
@interface MasterViewController () <DetailViewControllerDelegate, SettingsViewControllerDelegate>
@end
@implementation MasterViewController
....
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if([[segue identifier] isEqualToString:@"ShowSettings"]) {
// here settingsViewController._delegate is 0x075...
// why? where is this coming from?
SettingsViewController *settingsViewController = [segue destinationViewController];
// here settingsViewController._delegate is 0x00000 which I would expect
[settingsViewController setDelegate:self];
// here settingsViewController._delegate is still 0x0000 -- why?
}
}
I fixed it. That took way too long. I’ve learned my lesson. Thanks Jon for reminding me to use the debugger!
It works, but is this the right way to do it? [segue destinationViewController] was a UINavigationController.