futuretap/InAppSettingsKit — Issue #98: buttonTappedForKey never called - please help!
Author: TheaterGirl62
Created: 2011-11-11 10:51:23+00:00
State: open

I've had this same problem and it's driving me BATTY. I'm creating a tab-based app where one tab is solely dedicated to "Settings". I've checked and made sure to set the delegate as follows in the viewDidLoad of the ViewController of the first tab:

if (!appSettingsViewController) {
appSettingsViewController = [[IASKAppSettingsViewController alloc] initWithNibName:@"IASKAppSettingsView" bundle:nil];
appSettingsViewController.delegate = self;
}

The above code is in my viewDidLoad because if I put the initialization code in its own method, as follows:

- (IASKAppSettingsViewController*)appSettingsViewController {
if (!appSettingsViewController) {
appSettingsViewController = [[IASKAppSettingsViewController alloc] initWithNibName:@"IASKAppSettingsView" bundle:nil];
appSettingsViewController.delegate = self;
}
return appSettingsViewController;
}

this initialization method would never get hit. At the end of viewDidLoad, the delegate ivar IS set. However, when I hit a breakpoint at the end of [IASKAppSettingsViewController tableView:didSelectRowAtIndexPath:], delegate is no longer set. Where did it go?!

I'm making sure to conform to the protocol and set the delegate, but when I hit the button, my buttonTappedForKey method isn't called. From what I can see, everything is identical to the sample app, and yet it doesn't work… PLEASE help! Could it be something weird in the XIB file, since it's a tab-based app? But so is the sample app… please anyone out there, this has been driving me NUTS.