The first way to call
- (ibaction) FirstCall: (ID) Sender{
nsstring*phone =@ "18749627117";
if(phone !=nil){
[[ uiapplication sharedapplication" openurl:[ nsurl urlwithstring:[ nsstring stringwithformat: @" tel :%@ " ,phone]"; // Using this method, the contact list is entered after the call is completed
//[[uiapplicationsharedapplication] openurl:[nsurlurlwithstring:[nsstring stringwithformat:@ "telprompt://%@", phone]]];// Use this method before the call will pop-up box, ask whether to call, and then after the phone call back to the main program, Some people say that this method may not be legal, can not pass the audit
}
}
The second way to call
- (ibaction) Secondcall: (ID) Sender{
nsstring *str = [ nsstring stringwithformat : @ "tel:%@" @ " 18749627117 " ";
uiwebview *callwebview = [[ uiwebview Alloc " init];
[callwebview loadrequest:[ nsurlrequest requestwithurl:[ nsurl urlwithstring:str]"];
[self. Viewaddsubview: Callwebview]; // You can also not add to the page
}
iOS call feature