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: Jerry Krinock <email@hidden>
- Date: Wed, 1 Oct 2008 17:11:49 -0700
On 2008 Oct, 01, at 15:17, Michael Ash wrote:
Without seeing the rest of your code I can't say for sure, but this is
extremely suspect....
You should essentially always use this method (and any other method
that uses a SomeClass** parameter to "return" values) like this:
NSString *stringValue = nil;
[scanner scanUpToString:stopString intoString:&stringValue];
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.
Anyhow...thanks, Mike. I shall keep thinking about it.
_______________________________________________
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