如何在 NSString 中的 UITextview 中找到选定的文本
//Declare
NSString* myText = @"This is the first row and This is the second row";
myUITextview.text = myText;
// we have the same results in here "This is the" and "row"
//Then check it when text in UITextview is selected
- (void)textViewDidChangeSelection:(UITextView *)textView
{
NSString *selectedText = [textView.text substringWithRange:[textView selectedRange]];
//selectedText "This is" from the second not from the first
}
有没有办法承认这一点?相比?检查范围还是什么?