Question

i try to use TBXML and getting this error

TBXML "class method +tbXMLWithURL not found"

I try as in the example

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{

    TBXML * tbxml = [[TBXML tbxmlWithURL:[NSURL URLWithString:@"http://www.w3schools.com/XML/note.xml"]] retain];    


}
Was it helpful?

Solution

You have two different things in your code and in your error:

TBXML "class method +tbXMLWithURL not found"

in your code:

TBXML * tbxml = [[TBXML tbxmlWithURL:[NSURL URLWithString:@"http://www.w3schools.com/XML/note.xml"]] retain];

From the TBXML api:

- (id)initWithURL:(NSURL*)aURL Instantiates a TBXML object then downloads and parses an XML file for the given URL. The following code instantiates a TBXML object and parses the note.xml file from w3schools.com.

What I think you want:

TBXML *tbxml = [[TBXML alloc] initWithURL:[NSURL URLWithString:@"http://www.w3schools.com/XML/note.xml"]];

OTHER TIPS

I am not that familiar with the TBXML, but at a brief look at the site, wouldn't:

TBXML* tbxml = [[TBXML alloc] initWithURL:[NSURL URLWithString:@"http://www.w3schools.com/XML/note.xml"]];

be better?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top