IOS,Iphone 撥號三種方法

2021-07-02 14:01:59 字數 946 閱讀 2666

1,這種方法,撥打完**回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示

nsstring

* phonecall=[[

nsstring

stringwithformat

: @"tel:%@"

, @"185***078"];

]];

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

nsstring

* phonecall

=[[nsstring

stringwithformat:

@"tel:%@"

,@"185***078"

];uiwebview

* callwebview = [[

uiwebview

alloc

] init

];[callwebview 

loadrequest

:[nsurlrequest

requestwithurl

:[nsurl

urlwithstring

:phonecall

]]];

[self

.view

addsubview

:callwebview];

[callwebview 

release];

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

nsstring

* phonecall

=[[nsstring

stringwithformat:

@"tel:%@"

,@"185***078"];

[[] openurl

:[nsurl

urlwithstring

:phonecall

]]推薦使用第二種

三種方法 2020 11 23

利用連線類,例項化得到連線物件 連線類 連線物件 new 連線類 cmd.executescalar cmd.excutereader 關注其中一條資料 物件名.read 獲取關注列所對應的值 console.writeline 物件名 name while 物件名.read 功能,聚焦下一行資料。...

tomcat deploy專案三種方法

其中path制定訪問url路徑,docbase專案真是路徑 privileged true antiresourcelocking false antijarlocking false type org.apache.catalina.userdatabase 其中,docbase與第二種方式中的含...

類的三種方法

方法 函式 1 例項方法 函式 預設 2 類方法 函式 classmethod 3 靜態方法 函式 staticmethod class person person number 0 類變數 def init self name,gender 構造方法 用來物件初始化 self.name name ...