iOS to button binding call function

Source: Internet
Author: User

The button is first bound to the header file and the implementation file in the Xib file. Add the following code to the new method you created:

UIWebView*callwebview =[[uiwebview alloc] init];

nsurl *telurl =[nsurl urlwithstring:@ "tel:12345"];

[Callwebview loadrequest: [nsurlrequest requestwithurl: Telurl]];

// Remember to add to view

[self. Viewthis addsubview: Callwebview];

if (telurl==nil) {

nsstring *title;

title = @ " the user is not currently tied to the mobile phone number ";

nsstring *message = @ " please remind Ta to bind the phone number oh ";

uialertview *alertview = [[uialertview alloc] initwithtitle: Title

message: Message

delegate: Self

cancelbuttontitle:@ " OK "

otherbuttontitles:@ " Open Address Book ", Nil];

[Alertview show];

}

If determine if the number is empty, you need to prompt the user to open the Address Book, not implemented jump address book.

The Viewthis method is also declared in the header file.

iOS to button binding call function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.