I think you have a couple problems atleast from what I can see here,
You are using a
TabBar
inside of aViewController
, not aUITabBarController
, thus you need to useUITabBarDelegate
notUITabBarControllerDelegate
. You will have to manage the view controllers or whatever view you will want to be loaded on your own most likely with the delegate callback:-(void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item;
Also you dont have a UITabBar
defined in your controller, therefore your ViewController
has no idea you have a UITabBar
in your Storyboard. You need something like this:
@interface ViewController : UIViewController <UITabBarDelegate>
@property (weak, nonatomic) IBOutlet UITabBar *tabBar;
@end
Then you will need to Control drag from the ViewController
to your UITabBar
and back to connect the Delegate in your Storyboard.
Id recommend using a UITabBarController
so you dont have to manage the views yourself depending on what you are trying to accomplish.
Hope this helps!