Iphone – Detect a url in a UITableViewCell

iphone

I'm developing an iPhone app where I take the twitter feeds to a table view.currently I'm inserting a label as a sub view to the table cell to display multiple details.What I want to do is to detect urls inside that label where when we touch the urls,it should open up in safari.How can I do that?…..Hope you guys will help me.

Thanks.

Best Solution

It's not straightforward to do with just what's provided in the iPhone SDK.

Fortunately, the Three20 library has a TTStyledTextLabel that supports exactly what you want.

Here is a screenshot (using TTStyledTextTableItemCell which is a table cell with a TTStyledTextLabel):