• 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 off-by-one and I can't see why...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSScanner off-by-one and I can't see why...


  • Subject: Re: NSScanner off-by-one and I can't see why...
  • From: Alastair Houghton <email@hidden>
  • Date: Thu, 30 Apr 2009 14:53:51 +0100

On 30 Apr 2009, at 13:13, Alexander Spohr wrote:

When you call this on another than the first run:
range.location = [scanner scanLocation];
[scanner scanString:[[self class] delimiterString] intoString:NULL];
Your scanner still stands on the space coming from here:
[scanner scanUpToCharactersFromSet:[[self class] keyBreakingCharacterSet] intoString:&key]


You need to scan away the space:
[scanner scanString:[[self class] keyBreakingCharacterSet] intoString:NULL];

Well I think Graham is expecting the -scanUpToString: method to take care of that. Of course, it doesn't, but only because the to-skip character set it set to the default (whitespace + newline).


Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

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


References: 
 >NSScanner off-by-one and I can't see why... (From: Graham Cox <email@hidden>)
 >Re: NSScanner off-by-one and I can't see why... (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Bindings + NS{Secure}TextField validation -> coerced value is not used
  • Next by Date: Re: Bindings + NS{Secure}TextField validation -> coerced value is not used
  • Previous by thread: Re: NSScanner off-by-one and I can't see why...
  • Next by thread: How to use -optionDescriptionsForBinding: ?
  • Index(es):
    • Date
    • Thread