-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