I am getting Exception for substringWithRange:range in below method.
I am having textview with editing disabled.
i am using textfield only for text selection. when i am selecting text for firs time no exception but when i press for second time it throughs.
Exception: 'NSRangeException', reason: '* -[NSCFString substringWithRange:]: Range or index out of bounds'.
- (void)textViewDidChangeSelection:(UITextView *)textView {
NSRange range = [tv selectedRange];
str = [tv.text substringWithRange:range];
}