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

Could not cast value of type 'Charts.BarChartData' (0x10bbd31f0) to 'MYPROJ.BarChartData' (0x10aeed700). #825

Closed
indrajitv opened this issue Mar 10, 2016 · 4 comments

Comments

@indrajitv
Copy link

please i want urgent help

@indrajitv
Copy link
Author

internal override func calcMinMax()
{
super.calcMinMax()

    if (_data === nil)
    {
        return
    }

    let barData = _data as! BarChartData

    //HERE EXCEPTION THROWS
    _deltaX += 0.5

    // extend xDelta to make space for multiple datasets (if ther are one)
    _deltaX *= CGFloat(_data.dataSetCount)

    let groupSpace = barData.groupSpace
    _deltaX += CGFloat(barData.xValCount) * groupSpace
    _chartXMax = Double(_deltaX) - _chartXMin
}

@liuxuan30
Copy link
Member

would you check let barData = _data as! BarChartData? what is _data's dynamicType?
the error message is saying the casting on BarChartData failed, but I have no idea yet; not many clues

@danielgindi
Copy link
Collaborator

You are importing the framework twice.
The first time as an actual framework, the second as source compiled as part of your project.

@partyspy
Copy link

partyspy commented May 13, 2016

In "Identity Inspector", the custom class' module related to your chart view in IB might not be rightly set.
In my situation, the module part is somehow automatically set to MyProjectName instead of Charts, which caused the same issue as indrajtv encountered.
But I still have no idea why MyProjectName appeared as a ModuleName there.

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

4 participants