NSTextView row number

  • Hello,

    I have a NSTextView and would like to keep track of where the cursor is in
    terms of a line number. Please, is there a way to figure this out somehow
    (akin ti lineRangeForRange:) or do I have to calculate it myself, e.g. by
    caching newlines locations?
  • On May 22, 2012, at 3:14 PM, ecir hana wrote:

    > I have a NSTextView and would like to keep track of where the cursor is in
    > terms of a line number. Please, is there a way to figure this out somehow
    > (akin ti lineRangeForRange:) or do I have to calculate it myself, e.g. by
    > caching newlines locations?

    Ask the view's NSLayoutManager.

    —Jens
previous month may 2012 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today