2

I'm looking for a little help with making phone call from my app. The phone number is formatted as (###) ###-####.

In my .h I have this:

 IBOutlet UITextView    *PhoneNumber;

In my .m I tried these:

- (IBAction)callPhone:(id)sender 

    [[UIApplication sharedApplication] openURL:
     [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",PhoneNumber.text]]]; 

I'm unable to make it dial out the number. But when I tried this its work.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:#########"]];
DOK
  • 32,337
  • 7
  • 60
  • 92

1 Answers1

0

According to this site, the dashes should be ok. Just remove the parenthesis.

paul jerman
  • 601
  • 5
  • 13