-1

Possible Duplicate:
How to make a call programmatically?

I was wondering if this strip of code will work on iPhone, I can't test it since I only have ipodtouch and simulator.This is all there is to it in code. Also, are there any rules or guidelines that are against this do I need to add a message if it doesn't work? Thanks for any response I may receive.

 -(IBAction)callPhone:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:2135554321"]];
  }
Community
  • 1
  • 1

1 Answers1

0

Possible duplicate:

iPhone: make a call

It seems, you must change your code to

-(IBAction)callPhone:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://2135554321"]];
  }
Community
  • 1
  • 1
CReaTuS
  • 2,593
  • 1
  • 19
  • 31
  • Why do you have to add forward slashes and links? – rifterr after Oct 22 '12 at 00:19
  • You don't need the forward slashes, and probably should not include them as the standard defines `@"tel:2135554321"` as the correct format. However as far as I know it will work with slashes. – Abhi Beckert Oct 22 '12 at 09:38