On 30/05/2011, at 1:19 PM, Bing Li wrote:

> 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

>        NSArray *nodes = [xmlDoc nodesForXPath:xPath error:&err];

>                return [[nodes objectAtIndex:0] autorelease];


Your return type is NSString, but in fact you're returning NSXMLNode. Trying to 
treat it as a string leads to the errors you're seeing.

If the node contains the string, you need to return that instead, or if the 
string needs to be created from other data within the node, you need to do that.

--Graham


_______________________________________________

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