views:

240

answers:

1

I am creating a dictionary-style app that presents a tableview full of words, and when a word is selected, a UITextView is displayed that shows the definition of the word. What I would like to do is add a line that says "See also: synonym1, synonym2" where synonym1 and synonym2 are links that will take the user to the definition for the synonym that is touched.

What is the best way to add these dynamic links? Buttons? Somehow add a small UIWebView a UItable on the fly?

Thanks!

A: 

I would replace your UITextView with a UIWebView and use that contain your description text and your links. It's fairly trivial to generate HTML on the fly for something like that.

You could register a custom URL scheme for your app, or you could intercept links as they're clicked.

If your links are always grouped together there's no reason why you couldn't use a bunch of UIButtons inside a custom view, but then you'd have to handle layout and wrapping on your own. It seems a lot easier to do it in HTML.

Darren
Thanks for the answer and that link. I had shied away from the UIWebView because I didn't know how to intercept the links.
skantner