Add #import <Foundation/Foundation.h> in PNLineChat.m to fix CocoaPods bug
Showing
2 changed files
with
5 additions
and
8 deletions
| @@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
| 34 | 34 | ||
| 35 | -(void)setYLabels:(NSArray *)yLabels | 35 | -(void)setYLabels:(NSArray *)yLabels |
| 36 | { | 36 | { |
| 37 | - int max = 0; | 37 | + NSInteger max = 0; |
| 38 | for (NSString * valueString in yLabels) { | 38 | for (NSString * valueString in yLabels) { |
| 39 | NSInteger value = [valueString integerValue]; | 39 | NSInteger value = [valueString integerValue]; |
| 40 | if (value > max) { | 40 | if (value > max) { |
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | max = 5; | 48 | max = 5; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | - _yValueMax = max; | 51 | + _yValueMax = (int)max; |
| 52 | 52 | ||
| 53 | NSLog(@"Y Max is %d", _yValueMax ); | 53 | NSLog(@"Y Max is %d", _yValueMax ); |
| 54 | 54 |
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | #import "PNLineChart.h" | 9 | #import "PNLineChart.h" |
| 10 | #import "PNColor.h" | 10 | #import "PNColor.h" |
| 11 | #import "PNChartLabel.h" | 11 | #import "PNChartLabel.h" |
| 12 | +#import <Foundation/Foundation.h> | ||
| 12 | 13 | ||
| 13 | @implementation PNLineChart | 14 | @implementation PNLineChart |
| 14 | 15 | ||
| @@ -39,7 +40,7 @@ | @@ -39,7 +40,7 @@ | ||
| 39 | 40 | ||
| 40 | -(void)setYLabels:(NSArray *)yLabels | 41 | -(void)setYLabels:(NSArray *)yLabels |
| 41 | { | 42 | { |
| 42 | - int max = 0; | 43 | + NSInteger max = 0; |
| 43 | for (NSString * valueString in yLabels) { | 44 | for (NSString * valueString in yLabels) { |
| 44 | NSInteger value = [valueString integerValue]; | 45 | NSInteger value = [valueString integerValue]; |
| 45 | if (value > max) { | 46 | if (value > max) { |
| @@ -53,9 +54,8 @@ | @@ -53,9 +54,8 @@ | ||
| 53 | max = 5; | 54 | max = 5; |
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | - _yValueMax = max; | 57 | + _yValueMax = (int)max; |
| 57 | 58 | ||
| 58 | - NSLog(@"Y Max is %d", _yValueMax ); | ||
| 59 | float level = max /5.0; | 59 | float level = max /5.0; |
| 60 | 60 | ||
| 61 | NSInteger index = 0; | 61 | NSInteger index = 0; |
| @@ -115,7 +115,6 @@ | @@ -115,7 +115,6 @@ | ||
| 115 | NSInteger value = [valueString integerValue]; | 115 | NSInteger value = [valueString integerValue]; |
| 116 | 116 | ||
| 117 | float grade = (float)value / (float)_yValueMax; | 117 | float grade = (float)value / (float)_yValueMax; |
| 118 | - NSLog(@"index is %d and value is %d ymax is %d grade is %f",index, value, _yValueMax,grade); | ||
| 119 | if (index != 0) { | 118 | if (index != 0) { |
| 120 | 119 | ||
| 121 | [progressline addLineToPoint:CGPointMake(index * xPosition + 30.0+ _xLabelWidth /2.0, chartCavanHeight - grade * chartCavanHeight + 20.0)]; | 120 | [progressline addLineToPoint:CGPointMake(index * xPosition + 30.0+ _xLabelWidth /2.0, chartCavanHeight - grade * chartCavanHeight + 20.0)]; |
| @@ -125,8 +124,6 @@ | @@ -125,8 +124,6 @@ | ||
| 125 | [progressline stroke]; | 124 | [progressline stroke]; |
| 126 | } | 125 | } |
| 127 | 126 | ||
| 128 | - | ||
| 129 | - NSLog(@"Xvalue is %f Y value is %f",index * xPosition + 30.0+ _xLabelWidth /2.0, chartCavanHeight - grade * chartCavanHeight + 20.0 ); | ||
| 130 | index += 1; | 127 | index += 1; |
| 131 | } | 128 | } |
| 132 | 129 |
-
Please register or login to post a comment