I have a tabbed application written in Objective-C with 3 tabs and I want to add an additional tab that will call a UIAlertController
.
However, all tutorials explaining how to add additional tabs to Tab Bar always do so using storyboard, where you first add a viewcontroller and then a segue.
I just want to add a tab bar button and then call the UIAlertController
when that button is pressed. Any ideas on how to do this?
I tried adding the code
UIImage* anImage = [UIImage imageNamed:@"beaker.png"];
UITabBarItem* theItem = [[UITabBarItem alloc] initWithTitle:@"Home" image:anImage tag:3];
to the viewDidLoad
of my TabBarController
, but it did not work.
Any suggestions would be greatly appreciated!