How to parse and show hyperlinks (phone number/email addresses etc) in UILabel?
iphone
Solution
You could use UITextView as follows:
UITextView *myView = [[UITextView alloc] initWithFrame: frame];
myView.text = @"this is http://google.com link";
myView.editable = NO;
myView.dataDetectorTypes = UIDataDetectorTypeLink;
//cell is the TableView's cell
[cell.contentView addSubview:myView];
[myView release];
Problem
Almost everywhere in the iPhone, you can type text and the OS will recognize portion of the text to be hyperlinks (phone numbers, email addresses for example). However I tested this in my own app with a UILabel and it doesn't work. How do I activate this? Does the iphone sdk provide this functionality out of the box or do I have to do the parsing logic myself (which is a lot of work)?