Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown class LineChartView in Interface Builder file #59

Closed
MartinPajak opened this issue Apr 29, 2015 · 16 comments
Closed

Unknown class LineChartView in Interface Builder file #59

MartinPajak opened this issue Apr 29, 2015 · 16 comments

Comments

@MartinPajak
Copy link

I alwas get this runtime error when switching to the viewcontroller where the LineChartView is placed.
As proposed in this case of error I added "-all_load -ObjC" to the "Other Linker Flags" in project and targets settings, but this error still comes up. Any hint?

@danielgindi
Copy link
Collaborator

I cannot reproduce this...

@MartinPajak
Copy link
Author

The debugger stops at the line where I set the chartView (connected to storyboard) delegate to self.
And I do all this in Swift. I think showing how you embed "Charts" in a swift project (maybe with some pictures) would help many people to get it running.

@danielgindi
Copy link
Collaborator

Well I assume anyone coming here having a basic knowledge of Swift, ObjC and IB... There's no real reason to have a demo in Swift when there is one in ObjC, as the API is the same. Calling a function with square brackets or with a dotted syntax is the same and a programmer should not have a problem with that...

Now when it tells you that it's an unknown class - it is probably because it is.
Maybe you forgot that it is namespaced (Charts.LineChartView), or maybe you haven't embedded the framework correctly?

@MartinPajak
Copy link
Author

I already wrote the code in swift to use the lib, so we don't need a demo for "How I use it in swift", but we need a demo "How I embed it right". I followed your steps to embed Charts, and I also can compile the code and run the app, but when I switch to the ChartsViewController, I get the error.

I also tried with "Charts." to make sure the namespace is right, but the Storyboard cleans "Charts.LineChartVC" to "LineChartVC" and later then it didn't find the class with the error "Unknown class LineChartView in Interface Builder file."

@MartinPajak
Copy link
Author

I got it to run after:

  1. downloaded version 2.0.9
  2. reembedded it with the option "Embedded Content Contains Swift Code"
  3. In Storyboard where I defined the class for the charts view as "LineChartView", I also have to set the module manually to "Charts".
    screen shot 2015-05-05 at 11 17 44

It seems that the Storyboard not allways set the module for the class by it self, although it recognizes the class as known.

@MichaelArnoldOwens
Copy link

@MartinPajak Thanks for commenting the solution to your problem! Changing module to Charts did it for me!

@mprogers
Copy link

@MartinPajak And me, too. Thanks, Martin.

@btabuenca
Copy link

@MartinPajak 's solution worked for me. Thanks a lot!

@jweinstein2
Copy link

@MartinPajak Thank you!!! You saved me a lot of debugging time.

@mk3d
Copy link

mk3d commented Jan 31, 2016

@MichaelArnoldOwens me too! So long before to find this post and the solution! Thank you!!!!

@rubencodes
Copy link

@MartinPajak THANK YOU! I didn't realize you had to set the Module field as well. Had this issue with a totally unrelated library.

@cafemike
Copy link

cafemike commented Apr 4, 2016

@MartinPajak Thanks a lot !! Been researching for all sorts of solutions. Only this one works!

@ewhitley
Copy link

@MartinPajak Thank you, Martin. I also had this exact same issue with a separate library.

@jshin49
Copy link

jshin49 commented Jul 12, 2016

@MartinPajak Changing the Module Works like magic!!! Thanks so much Martin.

@jdannenbring
Copy link

Thanks, this fixed the problem. This solution should be added to the semi-official stack overflow answer for how to setup the charts project: http://stackoverflow.com/a/30648104/2789065

I'd do it but my lurker status on stack overflow doesn't let me comment yet

@KanybekMomukeyev
Copy link

@MartinPajak Thanks fixed problem!!!

wstejka added a commit to wstejka/CheckFP that referenced this issue Jun 16, 2017
…f class; there was needed to set "Chart" Module manually

For more info check: ChartsOrg/Charts#59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests