Re: Finding paragraphs in NSTextStorage
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.