• 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: NSScanner bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSScanner bug?


  • Subject: Re: NSScanner bug?
  • From: David P Henderson <email@hidden>
  • Date: Tue, 22 Oct 2002 17:56:04 -0400

On Tuesday, Oct 22, 2002, at 08:56 US/Eastern, Mark's Studio wrote:

I am trying to scan a text file, and i use this

if([theScanner scanUpToString:@"ABC" intoString:NULL])

if the textfile contains "ABC" at the beginning the scanner will not
find it, and it will not find the next "ABC".

BUG???

No, it is working as advertised. Since the test string starts with the stop case no characters are scanned. The method scans up to but does not include the stop string nor does it move the scanner past the stop string so subsequent scans never move beyond the start of the test string. To get the desired result you must follow the scanUpToString: message with a message which eats the stop string causing the scanner to move forward.

Dave
--
Chaos Assembly Werks
"Suburbia is where the developer bulldozes out the trees, then names the streets after them."
- Bill Vaughn
_______________________________________________
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: 
 >NSScanner bug? (From: "Mark's Studio" <email@hidden>)

  • Prev by Date: Re: Add rtf line to RTF file
  • Next by Date: NSTimer "takes over" CPU everytime it repeats?
  • Previous by thread: Re: NSScanner bug?
  • Next by thread: Jag Screen Savers not 10.1.x Compatible?
  • Index(es):
    • Date
    • Thread