0
如何以編程方式將NSTextView
滾動到光標位置?如何滾動到NSTextView中的光標位置?
如何以編程方式將NSTextView
滾動到光標位置?如何滾動到NSTextView中的光標位置?
這應該工作
NSUInteger cursorPosition;
cursorPosition = [[[self.textView selectedRanges] firstObject] rangeValue].location;
[self.textView scrollRangeToVisible:NSMakeRange(cursorPosition, 0)];