iOS撥打電話(三種方法)

2021-06-25 21:34:29 字數 746 閱讀 3791

2,這種方法,打完**後還會回到原來的程式,也會彈出提示,推薦這種

nsstring

* str=[[

nsstring

alloc

] initwithformat

:@"tel:%@",@"

186***x6979"];

uiwebview

* callwebview = [[

uiwebview

alloc

] init

];[callwebview 

loadrequest

:[nsurlrequest

requestwithurl

:[nsurl

urlwithstring

:str]]];

[self

.view

addsubview

:callwebview];

3,這種方法也會回去到原來的程式裡(注意這裡的telprompt),也會彈出提示(不推薦這種)

nsmutablestring

* str=[[

nsmutablestring

alloc

]  initwithformat

: @"telprompt://%@"

, @"

186***x6979"];

[] openurl

:[nsurl

urlwithstring

:str]]

iOS撥打電話(三種方法)

小弟查了很多地方的關於ios程式撥打 大都不全,今天我總結了三種方法,各有不同,拿來給大家分享,希望給大家有所幫助1,這種方法,撥打完 回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示 nsmutablestring 2,這種方法,打完 後還會回到原來的程式,也會彈出提示,推薦這種 n...

ios中撥打電話的三種方法

1,這種方法,撥打完 回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示 nsmutablestring str nsmutablestring alloc initwithformat tel 186 x6979 nslog str str 2,這種方法,打完 後還會回到原來的程式,也...

iOS 撥打電話三種方式

1,這種方法,撥打完 回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示 nsmutablestring str nsmutablestring alloc initwithformat tel 186 x6979 2,這種方法,打完 後還會回到原來的程式,也會彈出提示,推薦這種 nsm...