1

Using a RTLabel, I show eficently this html string:

<a href="http://maps.google.com/maps?q=Example Street, 1,  Rome">Example Street, 1</a>

as: Example Street, 1. Its clickable, but no action is done. Any RTLabel user Knows how active an action? Or if there is some altrnative to open in safari that link (in this case to show a map).

Thanks in advance

rmaddy
  • 314,917
  • 42
  • 532
  • 579
doxsi
  • 1,002
  • 19
  • 42

1 Answers1

2

Set the RTLabel delegate as:

[rtlabel setDelegate:self];

On tapping the link, the below function gets called. Handle accordingly:

-(void)rtLabel:(id)rtLabel didSelectLinkWithURL:(NSURL*)url
{

RTLabel * label = (RTLabel*)rtLabel;

[self openBrowserViewForURL:[url absoluteString] pageTitle:label.text];

}
Tarod
  • 6,732
  • 5
  • 44
  • 50
Amit
  • 61
  • 1
  • 7