1
enter code here-(IBAction)Call:(id)sender{
//[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://18005551234"]];
/*NSString *phoneStr = [[NSString alloc] initWithFormat:@"tel:%@",phoneNumber.text];
NSURL *phoneURL = [[NSURL alloc] initWithString:phoneStr];
[[UIApplication sharedApplication] openURL:phoneURL];
[phoneURL release];
[phoneStr release];*/
NSURL *url = [ [ NSURL alloc ] initWithString: @"tel:212-555-1234" ];
[[UIApplication sharedApplication] openURL:url];
}上記のコードでは ですが、私はいろいろな方法を使っていますが、誰も働いていません。関数上でブレークポイントを実装すると、スコープ外であると言います。これの問題は何ですか?ボタンを押すと、通話/ダイヤルの数値表示が開きます。
どちらが正しいですか? – ram
必要に応じて任意の方法を使用できます。携帯電話番号が動的な場合は、別の変数に保持して* stringWithFormat:*メソッドを使用して追加することができます。 – EmptyStack
どちらが良いですか?シミュレータでは、いずれかのwork.pleaseは、使用されているコード行を記述します。 – ram