标签: ios uitextview
当您在当前未编辑的UITextView上调用selectedRange时,您检查的NSRange返回值是什么?
答案 0 :(得分:22)
找到答案:
NSRange range = textView.selectedRange; if (range.location == NSNotFound) { //The textfield was not selected. } else { //There is a valid range. }