Re: NSScanner off-by-one and I can't see why...
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