Re: -[NSScanner scanUpToString:stopString:NULL] - 10.3.9 Crash, due Xcode 3.1?
Re: -[NSScanner scanUpToString:stopString:NULL] - 10.3.9 Crash, due Xcode 3.1?
- Subject: Re: -[NSScanner scanUpToString:stopString:NULL] - 10.3.9 Crash, due Xcode 3.1?
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Thu, 2 Oct 2008 07:54:44 -0400
- Thread-topic: Re: -[NSScanner scanUpToString:stopString:NULL] - 10.3.9 Crash, due Xcode 3.1?
>Yes, I see what you mean there. It looks suspicious without the rest
>of the code. Here is the entire method (without the logging)
>
>- (BOOL)scanUpToAndThenLeapOverString:(NSString*)stopString
> intoString:(NSString**)stringValue {
> [self scanUpToString:stopString intoString:stringValue] ;
> BOOL result = [self scanString:stopString intoString:NULL] ;
>
> return result ;
>}
>
>So you see I'm just passing that NSString** through in order to
>provide this handy addition to NSScanner. I've use this method "all
>over the place" with no trouble.
>
>And in this particular case, my invocation passes NULL for the second
>argument, and it logged as NULL (see original post), so I can't see
>how that value could be a problem.
I'm coming into this late, but are you positive you never accidentally pass in NULL like so:?
[blah scanUpToAndThenLeapOverString:@"someString" intoString:NULL];
Try logging what comes in and see if you ever actually do pass in NULL.
- (BOOL)scanUpToAndThenLeapOverString:(NSString*)stopString
intoString:(NSString**)stringValue {
if (stringValue == nil)
{
NSLog("stringValue cannot be NULL!");
return NO;
}
[self scanUpToString:stopString intoString:stringValue] ;
BOOL result = [self scanString:stopString intoString:NULL] ;
return result ;
}
Good luck,
Cem Karan
_______________________________________________
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