Wednesday 15 September 2010

ios - How to get the entire text when user taps on UItextview in Iphone -


I have a UITteview with some names along with it.

Founder: Eduardo Severin, Chris Hughes, Dustin Moskovitz, Mark Zuckerberg, Andrew McCullum

When a user clicks on any name, I can get that name and in the API call Must pass as a parameter. Can anyone tell me how to implement this functionality?

Thanks in advance.

@coding Voldemort posted an answer, then removed it for any reason.

The answer is that there is a property text in your text view that gives you the entire content:

  [target column and text: yourTextView.text]; Edit:  

Edit:

Use the selected range property of the text view to get a range of selections if you want the selected text, and NSString substring methods Such as part of the string to remove substringWithRange

If you want to notify the user when changing the selection, apply the delegate method textViewDidChangeSelection .


No comments:

Post a Comment