I have an app with 4 UIButtons and I want to pre-program phone numbers to each of them. I have written it like this:
- (IBAction)callFirst:(id)sender {
[NSURL URLWithString:@"tel.0739421700"];
}
- (IBAction)callSecond:(id)sender {
[NSURL URLWithString:@"tel.0705652000"];
}
- (IBAction)callThird:(id)sender {
[NSURL URLWithString:@"tel.0705666900"];
}
- (IBAction)callFourth:(id)sender {
[NSURL URLWithString:@"tel.0702857900"];
}
When I just open the app on the simulator it takes me to the log and shows errors. How should I write it instead?
This is what comes up when I run it. The “return UIApplicationMain… ” part is marked with green arrows on its edges. On the right it says ” Thread 1: signal sigabrt” Its from the main.m file:
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
thanks in advance!
something like this should work: