I am trying to capture the event each time a tab bar button is pressed and have added UITabBarControllerDelegate in the AppDelegate.h the below function to AppDelegate.m file but its not getting called. I have also connected tabBarController delegate to First Responder in the IB
Could anyone here help me fix this problem for me please?
// AppDelegate.h
@interface AppDelegate : UIResponder <UIApplicationDelegate, UITabBarControllerDelegate>
// AppDelegate.m
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
NSLog(@"Touched Tab\n");
}

All it needed was two lines in the below function to make the delegate work. Hope it saves time and frustration for someone.
// AppDelegate.m
{
}
// AppDelegate.h
}
@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController *m_pTabBarController;
@end