3

How to call a phone from a number entered in a UITextField?

 3 years ago
source link: https://www.codesd.com/item/how-to-call-a-phone-from-a-number-entered-in-a-uitextfield.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to call a phone from a number entered in a UITextField?

advertisements

I'd like to make a button call a phone number entered by the user inside the text field. I have a code but it doesn't work.

NSString * phoneNumber = [NSString stringWithFormat:@"%@%@", @"tel://", phoneNumber.text];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];

Anyone has a similar approach to this? Thanks.


I think it's tel: instead of tel://. See this Apple document. Try giving this a shot:

NSString *pn = [@"tel:" stringByAppendingString:phoneNumber.text];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:pn]];

Related Articles

How to call UWP API from the converted Win32 application. (Desktop Application Converter)

I converted Win32 app (C++) to UWP one successfully. But it can't work read/write file method, so I want to use UWP API from converted app. Supported UWP APIs for converted desktop apps I found this sentence "Most UWP APIs work well on converted desk

How to call a JSP from a diff site (project)?

Possible Duplicate: How do I include a jsp file from a diff project into my project How to call a JSP from a diff website(project)? I am trying to make a common project which would have a header and footer that all my web projects in my firm is going

How to call multiple functions from a single .m matlab file

This question already has an answer here: Calling local functions from command line 1 answer I have an algorithm written in one m file and i have several functions that i created in another .m file. I want to call these several functions i created in

how to call the method from another window in WPF

i have two windows win1 for display a list of Users and the other win2 for add user and i have a method to refresh the grid after deleted or updated or added user this method in win1 how i call this method from win2 after add user i'm sorry for my ba

How to call Winapi functions from PHP?

1) How to call winapi functions from PHP? 2) How to load any dll file and call functions from it? Platform: ms windows, php5 php_w32api extension is not avalaible. Maybe there is solution using COM objects?You mentioned stats. try... $wmi_call = "wmi

How to call a method from the UItableview delegate

1) My problem: how to call NumberofRowsInSection of UItableViewDataSource Method of another UItableViewdataSource. 2 ) HOw to make aggrateTableViewDataSource from n number of Different CustomTableViewDataSource? Need Help. ThanksI think there is some

How to call facebook javascript from a link?

i have this code: <html xmlns:fb="https://www.facebook.com/2008/fbml"> <body> <script src="http://connect.facebook.net/en_US/all.js"></script> <div id="fb-root"></div> <script> // ass

How to call an activity from a jar file in Android?

Please help me how to call activity from a jar file in android: My steps: I had a AndroidLibrary project with a MainActivity.java I had a AndroidApp project with a SplashActivity.java. I imported AndroidLibrary.jar to libs folder of AndroidApp projec

How to call a FragmentActivity from a FragmentActivity in Android

How can we call a FragmentActivity from a FragmentActivity on click of button .Please help me in this . And please help me to understand the difference between FragmentActivity and FragmentSimilar way what we are doing with Activities button1.setOnCl

How to call a function from another form

this is probably one of the most common question out there, having a FORM1 and FORM2, how I can call a function (on FORM1) like: MySQLConnect from FORM2. I tried couple of options and I can't get it to work, in the second attempt I tried calling the

PHP How to call the method from the extended class

Trying to use objects that extend singletone, but something I can't do. How to call method from extended class? How to show 13 non 12 with singleton? class SingletonTest { protected static $_instance; private function __construct(){} private function

How to call a UIView from a UIViewController

I need to create a transparent UIView with an UIActivityIndicator and an UIImage on it. I found a code from a tutorial as in how to create the Round edge UIView. Can someone help me call this UIView from my UIViewController class. (To call a UIViewCo

How to call a method from the java file in javascript?

I am new in JavaScript. I want to know how to call a simple method in Java file from JavaScript program. Could you please give me a simple example as well? Thank youJavascript will not be able to access server side java code directly. It will need to

How to call a method from the jar file in JSP?

I have Java program in that I have database connectivity, and few methods to be call to run SQL query. I generated jar file for that java file using Apache ANT. now I imported that jar file in my JSP. now how to call method executeQuery(String sql) f

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK