INs
INs

Reputation: 3159

Using GDataXMLDocument in iPad app

I'm trying to use GDataXML library in my ipad application. I followed by instructions:

If in code i add #import "GDataXMLNode.h", all is fine. But when i try to use GDataXMLDocument class in my app

GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:xmlData options:0 error:nil];

I received the following message:

Ld build/Debug-iphonesimulator/DemoApp.app/DemoApp normal i386
cd /Users/svp/Projects/DemoApp
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -L/Users/svp/Projects/DemoApp/build/Debug-iphonesimulator -F/Users/svp/Projects/DemoApp/build/Debug-iphonesimulator -filelist /Users/svp/Projects/DemoApp/build/DemoApp.build/Debug-iphonesimulator/DemoApp.build/Objects-normal/i386/DemoApp.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework MapKit -framework QuartzCore -lxml2.2 -o /Users/svp/Projects/DemoApp/build/Debug-iphonesimulator/DemoApp.app/DemoApp

Undefined symbols:
  "_OBJC_CLASS_$_GDataXMLDocument", referenced from:
      objc-class-ref-to-GDataXMLDocument in TwitterService.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Any thoughts?

Upvotes: 1

Views: 2181

Answers (3)

Eric Giguere
Eric Giguere

Reputation: 786

Best thing is to leave the source code untouched and tell your project not to apply the ARC mechanism to this file. To do so: 1- Select the build phases of your projet 2- Select the GDataXMLNode.m file 3- Add the switch: -fno-objc-arc to this file alone (by double clicking on it)

Bingo!

Hope it helps.

Upvotes: 1

grobbins
grobbins

Reputation: 1564

It sounds like the GDataXMLNode.m code isn't being linked in. Is that source file really added to the target being built in Xcode?

Upvotes: 3

Madhup Singh Yadav
Madhup Singh Yadav

Reputation: 8114

Check the following:

  • Have you copied the file into your project or just passed the reference of the file.
  • If you have not copied the file into your project (just passed the reference to it by drag drop or other ways), make sure that the path in "Header search Paths" is properly updated.

Its seems like you have missed to update the path from where you are referencing the file.

Upvotes: 1

Related Questions