I'm trying to determine, which particular character in UITextView
has been tapped. I tried to use characterRangeAtPoint:
method. But it always returns nil, wherever in the UITextView
I tap.
I even wrote and run the following piece of code:
for (int x = 0; x<1000; x++) {
pos.x = x;
for (int y = 0; y<1000; y++) {
pos.y = y;
UITextRange * range = [textView characterRangeAtPoint:pos];
if (range!=nil) {
NSLog(@"x: %f, y: %f", pos.x, pos.y);
}
}
}
Well, it never reaches the NSLog
string.
What am I doing wrong?