0

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];    


}
iNorD
  • 3
  • 2

2 Answers2

3

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"]];
vikingosegundo
  • 52,040
  • 14
  • 137
  • 178
Rui Peres
  • 25,741
  • 9
  • 87
  • 137
  • hi! Thank you for your answer! Now i get an error 'TBXML' may not respond to 'initWithURL' =( – iNorD Jun 14 '12 at 12:41
2

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?

Woody
  • 5,052
  • 2
  • 22
  • 28