我试图确定,哪个特定的角色UITextView被窃听了。我尝试使用characterRangeAtPoint:方法。但它总是返回 nil,无论我在哪里UITextView点击。我什至编写并运行了以下代码:
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);
        }
    }
}
好吧,它永远不会到达NSLog字符串。我究竟做错了什么?