-1
我以下面的方式開發一個調用程序。 我的主要目的是在文本框輸入號碼,每當我按下通話按鈕將它轉換如何從我的應用程序撥打電話?
成整數,然後進行調用action.in的Xcode是否有可能創造呼出一個
代碼?
有沒有可能阻止來電?
我在下面寫代碼的方式。
我的.h文件是
@interface mytextViewController : UIViewController
{
IBOutlet UILabel *enterphonenumber;
int currentNumber;
}
@property(nonatomic,retain)IBOutlet UILabel *enterphonenumber;
-(IBAction)call;
-(IBAction)press:(id)sender;
@end
我.m文件是
-(IBAction)press:(id)sender
{
currentNumber = currentNumber*10 + (int)[sender tag];
enterphonenumber.text = [NSString stringWithFormat:@"%i",currentNumber];
}
-(IBAction)call
{
int x =[enterphonenumber.text intValue];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:x]];
//[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"%tel:9963610177"]];
NSLog(@"sample %@",[NSURL URLWithString:@"my phone number is calling"]);
}
還怎麼檢查它執行主叫
請任意一個幫助,因爲我是新開發此應用程序
感謝你,
如何撥打電話以及如何阻止來電。 – 2012-03-31 10:31:59