其餘方法...?
objc NSArray *tmpArray = [self.zhiBiaoArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"month == '%@'", month]]];
objc NSString *regex = @"^[0-9]*$"; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"self matches %@",regex]; return [predicate evaluateWithObject:text];
tmpArray = [tmpArray sortedArrayUsingComparator:^NSComparisonResult(SuiFangItem *obj1, SuiFangItem *obj2) { return [obj1.SUBDATE compare:obj2.SUBDATE] == NSOrderedAscending;}];
for (NSInteger i = 0; i < tagBtnArray.count; i ++) { UIButton *tagBtn = tagBtnArray[i]; if (i == 0) { tagBtn.fd_x = 0; tagBtn.fd_y = 0; } else { UIButton *previousBtn = tagBtnArray[i -1]; tagBtn.fd_x = CGRectGetMaxX(previousBtn.frame) + 10; tagBtn.fd_y = previousBtn.fd_y; if ((tagViewW - tagBtn.fd_x) < tagBtn.fd_width) {tagBtn.fd_x = 0; tagBtn.fd_y = CGRectGetMaxY(previousBtn.frame) + 10; } } }
XMLDictionary
將 xml 轉成字典,再解析// 得到數據中存在的月份,共有哪幾個月份 NSMutableArray *monthArray = [NSMutableArray array]; ZhiBiaoItem *firstItem = self.zhiBiaoArray[0]; [monthArray addObject:firstItem.month]; for (NSInteger i = 1; i < self.zhiBiaoArray.count; i ++) { ZhiBiaoItem *item = self.zhiBiaoArray[i]; if (![item.month isEqualToString:firstItem.month]) { if ([monthArray containsObject:item.month]) { continue; } [monthArray addObject:item.month]; } } self.monthArray = monthArray; // 根據月份進行分組 NSMutableDictionary *resultDict = [NSMutableDictionary dictionary]; for (NSString *month in monthArray) { NSArray *tmpArray = [self.zhiBiaoArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:[NSString stringWithFormat:@"month == '%@'", month]]]; [resultDict setObject:tmpArray forKey:month]; } self.resultDict = resultDict;
使用 AFN 配置服務器本身建立的 https 證書的 https
+ 使用 AFN 忽略全部 https 證書、不檢測域名的策略sql
AFSecurityPolicy *secPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; secPolicy.allowInvalidCertificates = YES; secPolicy.validatesDomainName = NO; _mgr.securityPolicy = secPolicy;
+ `配置 AFN 本地 https證書? 不清楚如何配置` +
PNChart 修改 節點label 的大小,在源碼中修改數據庫
- (CATextLayer *)createPointLabelFor:(CGFloat)grade pointCenter:(CGPoint)pointCenter width:(CGFloat)width withChartData:(PNLineChartData *)chartData { CATextLayer *textLayer = [[CATextLayer alloc] init]; [textLayer setAlignmentMode:kCAAlignmentCenter]; [textLayer setForegroundColor:[chartData.pointLabelColor CGColor]]; [textLayer setBackgroundColor:[[[UIColor whiteColor] colorWithAlphaComponent:0.8] CGColor]]; [textLayer setCornerRadius:textLayer.fontSize / 8.0]; if (chartData.pointLabelFont != nil) { [textLayer setFont:(__bridge CFTypeRef) (chartData.pointLabelFont)]; textLayer.fontSize = [chartData.pointLabelFont pointSize]; } CGFloat textHeight = textLayer.fontSize * 1.1; CGFloat textWidth = width * 7; CGFloat textStartPosY; }
- (void)setXLabels:(NSArray *)xLabels withWidth:(CGFloat)width { }
- (void)setYLabels { PNChartLabel *minLabel = [[PNChartLabel alloc] initWithFrame:CGRectMake(0.0, (NSInteger) _chartCavanHeight - 10, (NSInteger) _chartMarginBottom, (NSInteger) _yLabelHeight)]; CGRect labelFrame = CGRectMake(0.0, (NSInteger) (_chartCavanHeight + _chartMarginTop - index * yStepHeight) -10, }
- (void)calculateChartPath:(NSMutableArray *)chartPath andPointsPath:(NSMutableArray *)pointsPath andPathKeyPoints:(NSMutableArray *)pathPoints andPathStartEndPoints:(NSMutableArray *)pointsOfPath { int x = i * _xLabelWidth + _chartMarginLeft + _xLabelWidth / 2.0 + 6; }