uitextfield光标定位参考代码

来源:互联网 发布:编程语言汇总 编辑:程序博客网 时间:2024/06/10 19:47
NSRange cursorPosition = [textview selectedRange];
        NSInteger index = cursorPosition.location;
        NSMutableString *content = [[NSMutableString alloc] initWithString:textview.text];  
        [content insertString:@"XXXXX" atIndex:index];
        textview.text = content;
        [content release];   
0 0