Problems in adding core plot frame work with existing project in Workspace

444 Views Asked by At

I want to use core plot in my project to display bar&scatter plots.Before that I made a prototype project where I was successful in plotting those two. But when I tried to include it into my project faced some problems.

1) My project has a static library so according to the https://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications, I added coreplot-cocoatouch.xcodeproj added too as a static library to my project and i set linker flags -ObjC as well for my app project then compiler throws a Mac linker error "Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1"

2) If I did not include -ObjC it throws error "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString sizeWithTextStyle:]: unrecognized selector sent to instance "

I am not able to find where am I doing wrong.Is it the problem with ARC because my project doesnt use ARC but as per some forums, I found we can use non ARC and ARC libraries in a single workspace.

I tried with CorePlot versions 1.3 and 1.4 & using Xcode 4.5, are these two arc or not.

Any help is appreciated.

Thanks in Advance.

2

There are 2 best solutions below

2
On BEST ANSWER

1 Possible reason may be that there are 2 different versions (duplicate) of Core-Plot Exists in your build directory.. or you have #import .m class instead of .h in your code.. sometimes same thing happens if you have 2 different classes with same name exists in your code.. Also do try cleaning your build directory and check again.

7
On
  1. Use the Core Plot dependent project or the pre-built static library, not both.

  2. The -ObjC linker flag is required. You also need the -all_load linker flag. That error message means that one of the category methods added by Core Plot did not load at runtime; the -all_load flag tells the linker to make sure the app knows to load those methods, too.