OK,我是弱智,所以我需要明确的指示,如何在底部的标签点击链接NSURL代码段拨打电话:联作用,以URL
- (void)viewDidLoad {
[super viewDidLoad];
lblText.text = agencyName;
lblPhone.text = phone;
lblEmail.text = email;
lblAddress.text = agcaddress;
//Set the title of the navigation bar
self.navigationItem.title = @"Agency Info";
mapView=[[MKMapView alloc] initWithFrame:self.view.bounds];
}
- (IBAction)callPlaceNumber:(id)sender {
NSString *number = [NSString stringWithFormat:@"tel://%@", phone];
number = [number stringByReplacingOccurrencesOfString:@" "
withString:@""];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:number]];
}
我试着用IBActions与出路搞乱无济于事。我是否需要在我的头文件中放置一个IBAction,并以某种方式将它链接到标签?第三天编码目标c和I-OS对我来说很简单。
能不能请你改一下你的问题?你到底想做什么?通过单击标签打开URL onViewLoad或打开URL? – doNotCheckMyBlog 2011-12-29 01:01:28
或者您想通过点击按钮拨打电话? – doNotCheckMyBlog 2011-12-29 01:03:30
是的,点击标签打开网址。抱歉。 – savagenoob 2011-12-29 01:03:43