UILabels don't have methods for triggering events when they are clicked so you can detect a click manually from the touch event
In #ViewController.h
IBOutlet UIView *mainView;
IBOutlet UILabel *UrlLabel;
In interface builder
Right click Files Owner.
Drag the mainView outlet onto the view.
Drag the UrlLabel outlet onto the label
In #ViewController.m to open a URL in safari
//********** SCREEN TOUCHED **********
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//See if touch was inside the label
if (CGRectContainsPoint(UrlLabel.frame, [[[event allTouches] anyObject] locationInView:mainView]))
{
//Open webpage
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]];
}
}
Ensure you have saved the xib before running or it won't work!
To Call a telephone number
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:0044-1234-567-890"]];
The apple documentation:
http://developer.apple.com/iPhone/library/featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html#//apple_ref/doc/uid/TP40007893