• 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
How does -getLineStart:end:contentsEnd:forRange work ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How does -getLineStart:end:contentsEnd:forRange work ?


  • Subject: How does -getLineStart:end:contentsEnd:forRange work ?
  • From: email@hidden
  • Date: Thu, 29 Jun 2006 16:14:08 +0200 (CEST)
  • Importance: Normal

>Use NSString methods such as lineRangeForRange:, paragraphRangeForRange:,
>getLineStart:end:contentsEnd:forRange:, or
getParagraphStart:end:contentsEnd:forRange:.

  Thanks for your advice Douglas. Unfortunately, as it's my first encounter
with those functions I got everything wrong again. Just to gain familiarity
with the     -getLineStart:end:contentsEnd:forRange, I tried the following
fantasy
code :

        unsigned* startIndex=47;
	unsigned* lineEndIndex=48;
	unsigned* contentsEndIndex=49;
	unsigned i;
    for (i=0;i<l1;i++) {
	      [z1 getLineStart:startIndex
	          end:lineEndIndex
		      contentsEnd:contentsEndIndex
		      forRange: NSMakeRange(i,1)];
	}
(z1 is an NSString whose length is large,>50).

 The loop crashes immediately (when i=0). What is wrong with
this code ?  (in my mind it was supposed to compute for each i
the index of the line containing the ith character).

                                        Ewan




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How does -getLineStart:end:contentsEnd:forRange work ?
      • From: Uli Kusterer <email@hidden>
    • Re: How does -getLineStart:end:contentsEnd:forRange work ?
      • From: Jonathon Mah <email@hidden>
  • Prev by Date: Re: Bind to element in dictionary in array
  • Next by Date: RE: Help needed in NSSplitView
  • Previous by thread: RE: Help needed in NSSplitView
  • Next by thread: Re: How does -getLineStart:end:contentsEnd:forRange work ?
  • Index(es):
    • Date
    • Thread