views:

709

answers:

4

Using core-plot does not seem to be an easy integration task. Header path are already setup. In Interface-Builder I create an CPLayerHostingView which belongs to a View Controller which is instantiated by Interface Builder.

When the nib file is loaded I get the message:

Unknown class CPLayerHostingView in Interface Builder file
+1  A: 

I think you're saying that you get this error when you load the NIB file in your app's code. In that case, the error suggests that you haven't built the Core Plot classes into your application (iPhone) or linked against the CorePlot framework and copied into the app bundle's Frameworks/ directory (OS X).

Barry Wark
I added the core plot xcode project as a dependency. The library is linked correctly....
Sney
Is the CorePlot framework also being copied into the app bundle's Frameworks/ directory via a "Copy Files" build phase?
Barry Wark
A: 

http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application

Here is the answer ..

U can see mars' answer there

"i got it to work....ok, i added the -all_load -ObjC flag in the Target>Settings....I think this is where everyone gets confused...There are 2 places where to put the other link and header search paths, in Project Settings and in Target Settings.."

So solution is

Add -all_load -ObjC in Project settings and target settings

Sijo
A: 

I had to rename CPLayerHostingView to CPGraphHostingView to get this to work after upgrading to the latest version of core plot (along with iOS 4 and the upgrade of XCode).

David Conlisk
A: 

CPGraphHostingView thank u it worked for me aswell; 3 imp things 1>perform settings for both project target aswell as application target.(make sure configuration is all configuration) 2>give correct header search path for framework library 3>learn over it::::::-)

pintu