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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to