How to dial a number by pressing a call button in an iphone app?
<p>I am  using a table view in  which each sell has a particular phone number along side a call button on pressing which the number is dialed...For example if i have a phone number in the cell as (425)821-1300 i changed it into the standard format 425-821-1300 by the code as shown below using the string variable phonenumberstring</p>

<pre><code> phonenumberstring=[phonenumberstring substringFromIndex:1];
 phonenumberstring=[phonenumberstring stringByReplacingOccurrencesOfString:@")" withString:@"-"];

 m_strPhoneNumber = [NSString stringWithFormat:@"tel:%@", self.phonenumberstring];
//[[UIApplication sharedApplication] openURL:[NSURL URLWithString:m_strPhoneNumber]];
 NSURL *url = [[NSURL alloc] initWithString:m_strPhoneNumber];//1
 [[UIApplication sharedApplication] openURL:url];//2
</code></pre>

<p>the thing is using this when i debug at commented lines 1 &amp; 2 url is shown nill and the call is not dialled</p>

<p>Regards</p>

<p>Arun</p>
