Please do tell how I can make a call with the iPhone.
Below is the code I have written, but nothing happens when the button is clicked. Is it a problem of the simulator and would it work on the phone, or is there any mistake in code?
- (void)applicationDidFinishLaunching:(UIApplication *)application {
UIButton *uiButton_G_obj = [UIButton buttonWithType:UIButtonTypeRoundedRect];
uiButton_G_obj.frame = CGRectMake(80, 30, 80, 30);
[uiButton_G_obj addTarget:self action:@selector(buttonAction:)forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:uiButton_G_obj];
[window addSubview:self.view];
// Override point for customization after application launch
[window makeKeyAndVisible];
}
-(void)buttonAction:(id)sender{
NSLog(@"Inside button action");
[[UIApplication sharedApplication]openURL:[NSURLURLWithString:@"tel:12125551212"]];
}
So, on a click of the button only
"Inside button action"
line is printed... But no phone call service is instantiated :( please help me out.
I just want to know, how can I instantiate a call service programmatically?