• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Getting the current line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting the current line


  • Subject: Getting the current line
  • From: Ricardo Diaz <email@hidden>
  • Date: Thu, 23 Aug 2007 08:47:52 +0000
  • Importance: Normal

How can I get the current line the insertion point is in? I tried modifying this code that gets the current column but got nothing:

NSRange selectionRange = [textView selectedRange];
unsigned int selection = selectionRange.location;
unsigned int end = [[textView string] lineRangeForRange:selectionRange].location-1;
unsigned int currentCol = (selection-end);

Any ideas?
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Getting the current line
      • From: Seth Willits <email@hidden>
  • Prev by Date: Re: subpathsAtPath and memory usage
  • Next by Date: Hillegass cocoa question
  • Previous by thread: Re: releasing an NSPanel
  • Next by thread: Re: Getting the current line
  • Index(es):
    • Date
    • Thread