Question

I'm trying to purse a XML file with TBXML I have done to following steps to use TBXML

  1. Click on your project main folder inside of XCode 4.0
  2. Click on the target
  3. Open tab called "Build Phases"
  4. Open up "Link Binaries With Libraries"
  5. Click "+" find the libz.dylib file
  6. Copy the needed files (TBXML.h, TBXML.m, NSDataAdditions.h, NSDataAdditions.m) into a group in my project
  7. added the #import "TBXML.h" on top of the page I'm going to use the library

after I add the following line (taken from the TBXML Guides) it comes up with an error that I should not use retain if I'm using Automatic Reference Counting.

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

After I remove the retain I end up with

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

When I try to run the App it shows the Following Errors:

"_OBJC_CLASS_$_TBXML", referenced from:
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386


clang: error: linker command failed with exit code 1 (use -v to see invocation)

What should I do and how can I fix it?

Thank you

Was it helpful?

Solution

Make sure that you have included your file in target i.e. it is check marked in target membership tab

Full screen image

enter image description here

OTHER TIPS

This error means that the linker cannot find the compiled code for TBXML - most likely because it's not actually being compiled.

Select the TBXML.m file in the navigator, then open the "Utilities" panel on the right and make sure that your target is checked under "Target Membership".

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