如何在NSTextView中找到插入位置?

rui*_*eco 12 cocoa objective-c nstextview

我有一个带有几个分号分隔字符串的NSTextView.我需要找到插入符号中的哪些字符串.我怎么能这样做?

Art*_*pie 29

NSInteger insertionPoint = [[[myTextView selectedRanges] objectAtIndex:0] rangeValue].location;
Run Code Online (Sandbox Code Playgroud)