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

When I use the barChart , my code crashed with exc_bad_access #79

Closed
vesper305 opened this issue Jul 24, 2014 · 8 comments
Closed

When I use the barChart , my code crashed with exc_bad_access #79

vesper305 opened this issue Jul 24, 2014 · 8 comments

Comments

@vesper305
Copy link

It seems that the code: [barChart strokeChart] , was trying to release some memory that has already been releaseed.

I can't figure it, so I post it.

Have a nice day :-).

@onunix
Copy link

onunix commented Aug 4, 2014

so am i; when i use barchart ,it crashed.

@vicc
Copy link

vicc commented Aug 9, 2014

Same here. I traced the exc_bad_access error to the following line in PNBarChart.m:

NSString *labelText = _yLabelFormatter((float)_yValueMax * ( (_yLabelSum - index) / (float)_yLabelSum ));

A quick fix is replace that with:

NSString *labelText = @"";

@fabio-nogueira-almeida
Copy link

I Have the same problem.

@mafb
Copy link

mafb commented Aug 28, 2014

Same here.

@revolter
Copy link

revolter commented Sep 9, 2014

Same

@lixom
Copy link

lixom commented Oct 4, 2014

The Demo app uses the following code that seems to work:

self.barChart.yLabelFormatter = ^(CGFloat yValue){
            CGFloat yValueParsed = yValue;
            NSString * labelText = [NSString stringWithFormat:@"%1.f",yValueParsed];
            return labelText;
        };

https://github.com/kevinzhow/PNChart/blob/master/PNChartDemo/PCChartsTableViewController.m#L103-132

@vlouro
Copy link

vlouro commented Oct 17, 2014

i get the same error but if i change to this NSString *labelText = @""; the chart doesnt appear. Any suggestion ?

@pixnbit
Copy link

pixnbit commented Oct 30, 2014

+1, _yLabelFormatter not initialized

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

10 participants