Search code examples
objective-cxcode4.2gdata

elementsForName method of GDataXML not found .. but its in the header file etc


Im using GDataXML to do XML parsing etc in XCode 4. The example I'm following requires use of a method called elementsForName. I can see this method in the GDataXMLNode.h and .m, and Im including GDataXMLNode.h in my header file. Im calling it like this :

- (GDataXMLElement *)elementForChild:(NSString *)childName {
    NSArray *children = [self elementsForName:childName];    //<---- prog hangs here 
    if (children.count > 0) {
        GDataXMLElement *childElement = (GDataXMLElement *) [children objectAtIndex:0];
        return childElement;
    } else return nil;
}

I dont believe its this code itself thats wrong - for some reason it just wont find the elementsForName method there.

I've added usr/include/libxml2 to the header search paths. Can anyone see or imagine a reason why I cant use a method that seems to be there? Thanks for any assistance.


Solution

  • I realize this is an old question but I believe that all you have to do is format the childName argument as a string like so:

     @"childName"