2013-01-09 43 views

回答

0

試試這個:

NSString *deviceType = [UIDevice currentDevice].model; 
     if([deviceType isEqualToString:@"iPhone"]) 
     { 
      NSString *phoneNumber = [@"tel://" stringByAppendingString:@"8437327307"]; 
      [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]]; 
     } 
     else 
     { 
      UIAlertView *device = [[UIAlertView alloc] initWithTitle:@"ipod" message:@"Can't Call from this device" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil]; 
      [device show]; 
      [device release]; 
     } 
+0

代替我沒有。你可以添加你的沒有。靜態或動態... – Vishal

+0

謝謝維沙爾。我已經嘗試過這段代碼,但是,那在contactView中不在我的應用程序視圖中。請幫助我。 –

+0

請參閱此鏈接:http://stackoverflow.com/questions/12065498/make-phone-call-on-iphone-and-take-user-back-to-app-uiwebview-does-it – Vishal

1

嘗試

-(void)makeACall:(NSString *)strContactNumber 
{ 
    UIWebView *webView = [[UIWebView alloc] init];  
    NSString *ph_no = [NSString stringWithFormat:@"tel:%@",strContactNumber];  
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:ph_no]]]; 
} 
+0

從Receiver端斷開連接後,在應用程序視圖中不返回。請幫幫我。 –

+0

我給你鏈接...檢查它@iphone_Kanta。 – Vishal

+0

它適用於我,如果沒有幫助,那麼@Vishal共享鏈接的另一個選項。 – Girish