NSScanner woes
NSScanner woes
- Subject: NSScanner woes
- From: "Mark A. Stratman" <email@hidden>
- Date: Mon, 24 May 2004 23:55:48 -0500
Hello,
I have a scanner with its scan location right before a "\r\n". I'm
trying to scan past it but am having problems.
Originally I just did a [scanner scanString:@"\r\n" intoString:nil],
but it didn't scan past it as I expected.
if (! [scanner scanString:@"\r\n" intoString:nil]) {
if ([[str substringWithRange:NSMakeRange([scanner scanLocation],2)]
isEqualToString:@"\r\n"]) {
NSLog(@"this should never happen");
}
}
//Where "str" is the string I created the scanner with.
Sure enough, the NSLog message gets printed. The second 'if' shows
that there is, indeed, a "\r\n" at the scan location... but it's not
getting scanned.
What gives? Any ideas? I'm assuming that I'm missing something
painfully obvious, and hopefully somebody here can pick it up.
Thanks,
Mark A. Stratman
_______________________________________________
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.