Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create an action for a UITabBarItem?

Tags:

iphone

I have created a UITabBar and UITabBarItems without UITabBarController on it, now i want to know how to place an action on click of the UITabBarItem.What is the method i should use for action on UITabBarItem?

like image 547
suse Avatar asked Mar 25 '10 05:03

suse


1 Answers

You can't set an action on a UITabBarItem object directly. Instead, your view controller should implement the following UITabBarDelegate method:

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item;

This method is called when the user selects a tab (i.e. UITabBarItem).

like image 96
Shaggy Frog Avatar answered Sep 19 '22 19:09

Shaggy Frog