Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
セミコロンで区切られた文字列がいくつかあるNSTextViewがあります。私はそれらの弦のどれにカレットが置かれているかを見つける必要があります。どうすればそれができますか?
NSInteger insertionPoint = [[[myTextView selectedRanges] objectAtIndex:0] rangeValue].location;
Swift4の場合
let insertionPointIndex = myTextView.selectedRanges.first?.rangeValue.location