Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!)
Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!)
- Subject: Re: NSScanner baffling behaviour (scanString:intoString: doesn't work!)
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 08 Apr 2003 11:29:49 -0400
on 03-04-08 5:51 AM, Greg Hurrell at email@hidden wrote:
>
Can anyone tell me why the following method isn't working?
>
>
It's supposed to scan a string for material between "startTag" and
>
"endTag". For example, calling:
>
>
[[self class] _scanString:@"<p>This is some <b>HTML</b> code!</p>"
>
startTag:@"<b>" endTag:@"</b>"]
>
>
Is supposed to return the first instance of text between "<b>" and
>
"</b>" (ie. "HTML").
>
>
// scan a string (source) for material between startTag and endTag
>
+ (NSString *)_scanString:(NSString *)source
>
startTag:(NSString *)startTag
>
endTag:(NSString *)endTag
>
{
Are you sure your method is being called at all? It doesn't sound like it
is. Put an unconditional NSLog(@"executed") statement at the beginning, and
you'll find out.
Unofficially, Apple reserves the use of a leading underscore character in
method names for their own use. I'm just guessing, but your code might be an
example of why that is so. If NSScanner implements a private method with a
signature identical to that of your method, then the NSScanner private
method will probably get called instead of your method.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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.