I need to retrieve when a user click over a tabbaritem into a uitabbarcontroller to change something..
here is my code:
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
if (item == [tabBarController.tabBar.items objectAtIndex:2]) {
item.title = @"add shot";
}
else
{
item.title = @"Race";
}
}
but If I do this:
self.tabBarController.tabBar.delegate = self;
i receive a sigkill…
what’s the right solution? thanks in advance
Does your view controller conform to the UITabBarDelegate protocol?
In the header file:
Then, just do:
Instead of:
And: