Dear all,

I got a problem when processing NSString returned from a method, which
extracting data from an XML. The data is extracted correctly by the
following method.

However, when executing "isEqualToString" with the returned NSString, it got
the exception as follows.

"-[NSXMLNode isEqualToString:]: unrecognized selector sent to instance
0x1001233e0"

If tracking with XCode, the NSString variable which holds the returned value
from the following method is specified as "Variable is not a CFString". How
to fix the bug?

+ (NSString *) Read:(NSString *)xml Path:(NSString *)xPath
{
        NSError *err = nil;
        NSXMLDocument *xmlDoc = [[NSXMLDocument alloc] initWithXMLString:xml
options:NSXMLDocumentTidyXML error:&err];
        NSArray *nodes = [xmlDoc nodesForXPath:xPath error:&err];
        [xmlDoc release];
        [err release];
        if ([nodes count] > 0)
        {
                return [[nodes objectAtIndex:0] autorelease];
        }
        else
        {
                return Constants.WWW.EMPTY_STRING;
        }
}

Thanks so much!
Bing
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to