Create buttons from a text array
Sorry I can't think of a good title for this but here' my situation: I have bunch of text in a UITextView, and I want开发者_JAVA技巧 some words to becomes buttons (the list of words can be in an array)...and basically, when the user clicks these buttons, it will push a uiviewcontroller on the nav controller displaying details about that word....
My main problem is: How can I make these select words buttons? What the best way to do this? Thanks
If you don't need editing of the text I suggest using a UIWebView and making those words links. Then implement the UIWebViewDelegate method: webView:shouldStartLoadWithRequest:navigationType:
and catch clicking of a link with it. Then show your viewcontroller.
精彩评论