• 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
Re: Finding paragraphs in NSTextStorage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding paragraphs in NSTextStorage


  • Subject: Re: Finding paragraphs in NSTextStorage
  • From: Ali Ozer <email@hidden>
  • Date: Mon, 23 Feb 2004 09:37:15 -0800

I need to be able to calculate the count of the paragraphs in a textview I have.

Look at NSString's lineRangeForRange: and paragraphRangeForRange:... methods. The former will figure out the distinct lines (not "layout" lines, as they appear in a textview, but character sequences separated by line or paragraph breaks), and the latter, new to 10.3, will do just paragraphs.

You can use these to efficiently enumerate through the paragraphs and get a count.

Ali
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Finding paragraphs in NSTextStorage (From: Joshua Scott Emmons <email@hidden>)

  • Prev by Date: Re: NSTableView [solved]
  • Next by Date: Re: Problems with ApplicationShouldTerminateAfter...
  • Previous by thread: Re: Finding paragraphs in NSTextStorage
  • Next by thread: New to Objective-C/Cocoa Programming
  • Index(es):
    • Date
    • Thread