0

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!

Borys Verebskyi
  • 4,160
  • 6
  • 28
  • 42
  • What does your code look like to present the `UIAlertController`? – timgcarlson Mar 12 '16 at 16:08
  • This answer is probably relevant to your needs, it shows you how to create a category on `UIAlertController` so that you can present it from non view controllers http://stackoverflow.com/a/30941356/2241714 – timgcarlson Mar 12 '16 at 16:10

0 Answers0