gpt4 book ai didi

objective-c - 如何在 NSTextView 中找到插入符位置?

转载 作者:太空狗 更新时间:2023-10-30 03:23:05 24 4
gpt4 key购买 nike

我有一个带有几个分号分隔字符串的 NSTextView。我需要找到插入符号放置在哪些字符串上。我怎么能那样做?

最佳答案

NSInteger insertionPoint = [[[myTextView selectedRanges] objectAtIndex:0] rangeValue].location;

关于objective-c - 如何在 NSTextView 中找到插入符位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1701129/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com