I’m trying to create a UITabBarControllerDelegate for my Story Board Tab Bar controller…
#import <Foundation/Foundation.h>
@class CountryPickerViewController;
@interface TabBarDelegate : NSObject <UITabBarControllerDelegate>
@property (strong) CountryPickerViewController *countryPickerViewController;
- (void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController;
@end
Using Interface Builder I created an Object and then assigned it as a delegate like this:

When I switch to another tab, it results in a crash. What’s going on here and how can I fix it?
EDIT: By the way, the method implementation for tabBarController:didSelectViewController: is empty (doesn’t contain any particular logic)
EDIT2: I don’t get a decent stack trace, I get:

and EXC_BAD_ACCESS, I would assume that the Tab Bar Delegate object could be nil? Why could this be going on?
EDIT3: I enabled NSZombies and found out that for some reason the Object that I created in Interface Builder is getting released too soon? Is this normal ?
2012-08-01 12:41:11.591 MyApp[15437:707] *** -[TabBarDelegate respondsToSelector:]: message sent to deallocated instance 0x194fe0
IBOutlets are not retained. You need a strong reference to your tab bar delegate in order to keep it around long enough to be used by your view. Right now it’s being released immediately after the view is loaded.