I’ve been searching for this, can’t find the answer.
I’m setting up a UIStoryboard in Interface Builder, and while everything is working fine, I seem to be unable to hook up the delegate outlet of the UITabBarController to any of the UIViewController‘s in the UIStoryboard, regardless of their position in the UIStoryboard. I’ve set the UIViewController‘s to be a <UITabBarControllerDelegate> in the .h file, but Interface Builder won’t allow me to select the UIViewController as the delegate for the UITabBarController.
Has anyone run into this issue?
It turns out that the reason you can’t set the
delegatein theUIStoryboardis because you have no guarantee that theUIViewControlleris loaded before theUITabBaris loaded. Therefore, programmatically setting thedelegate(in a differentUIViewController) is the ONLY way to accomplish this.