1

i'm sorry for my english.

I'm trying to develop an app and in one of my tab bar item i want provide the functionality to start a phone call.

I know that is possible to start a call with the following code that i found in another topic:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:12125551212"]]; 

Is possible integrate this method in a "tab bar item"?

Manuel Ragazzini
  • 919
  • 1
  • 10
  • 24
  • Did you try adding that code to the event handler for the tab bar item? http://mattgemmell.com/2008/12/08/what-have-you-tried/ – PaulProgrammer Apr 20 '13 at 16:33

1 Answers1

2

You can use

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController

and check the viewController.tabBarItem and even return NO to not select view controller and only initiate the call

UITabBarControllerDelegate

Or Arbel
  • 2,965
  • 2
  • 30
  • 40
  • Thank's for your replay!! i suppose that is the right answer but i'm new in app development and i need to study better the delegate to implement your solution and check the answer... thank's a lot!! Just as possible i'll confirm the answer!! – Manuel Ragazzini Apr 21 '13 at 15:45