diff --git a/LifeLog/LifeLog/HistoryObject.m b/LifeLog/LifeLog/HistoryObject.m index ba70e36..a18876f 100644 --- a/LifeLog/LifeLog/HistoryObject.m +++ b/LifeLog/LifeLog/HistoryObject.m @@ -54,7 +54,8 @@ NSDictionary * graph = [dict objectForKey:@"data_chart"]; if([graph count] == 24) { for(int i = 0; i < 24; i++) { - [self.dataGraph addObject:[graph objectForKey:[NSString stringWithFormat:@"%d", i]]]; + if(![graph isKindOfClass:[NSArray class]]) + [self.dataGraph addObject:[graph objectForKey:[NSString stringWithFormat:@"%d", i]]]; } } } diff --git a/LifeLog/LifeLog/HistoryViewController.m b/LifeLog/LifeLog/HistoryViewController.m index a3e38f5..9fcc38b 100644 --- a/LifeLog/LifeLog/HistoryViewController.m +++ b/LifeLog/LifeLog/HistoryViewController.m @@ -114,7 +114,7 @@ -(void) updateView { HistoryObject * obj = [_curHisArray objectAtIndex:self.viewCollectionMode.getCurrentIndex]; - self.lblStep.text = [NSString stringWithFormat:@"%d step", obj.step]; + self.lblStep.text = [NSString stringWithFormat:@"%d step", obj.target]; self.lblCircleStep.text = self.lblStep.text; self.lblRemaining.text = [NSString stringWithFormat:@"%d step", obj.missing]; self.lblCircleRemain.text = [NSString stringWithFormat:@"目標まであと\n%d stepです", obj.missing]; diff --git a/LifeLog/LifeLog/ServerAPI.m b/LifeLog/LifeLog/ServerAPI.m index 1aaa8ff..297c631 100644 --- a/LifeLog/LifeLog/ServerAPI.m +++ b/LifeLog/LifeLog/ServerAPI.m @@ -408,7 +408,7 @@ NSURLSessionDataTask * searchTask; #pragma mark - History Screen Function - (void) requestHistory:(NSString *)token startDate:(NSDate *)startDate endDate:(NSDate *)endDate CompletionHandler:(void (^)(NSArray *, NSError *)) completion { - NSString *url = [kServerAddress stringByAppendingFormat:@"/api/history/%@/%@", [Utilities stringFromDate:startDate withFormat:@"YYYYMMdd" locale:@""], [Utilities stringFromDate:endDate withFormat:@"YYYYMMdd" locale:@""]]; + NSString *url = [kServerAddress stringByAppendingFormat:@"api/history/%@/%@", [Utilities stringFromDate:startDate withFormat:@"YYYYMMdd" locale:@""], [Utilities stringFromDate:endDate withFormat:@"YYYYMMdd" locale:@""]]; NSLog(@"requestHistory link %@", url); [self _request:url method:@"GET" token:token paras:nil completion:^(NSData *data, NSError *error) { @@ -467,7 +467,7 @@ NSURLSessionDataTask * searchTask; } - (void) requestHistoryList:(NSString *)token startDate:(NSDate *)startDate endDate:(NSDate *)endDate CompletionHandler:(void (^)(NSArray *, NSError *)) completion { - NSString *url = [kServerAddress stringByAppendingFormat:@"/api/history/detail/%@/%@", [Utilities stringFromDate:startDate withFormat:@"YYYYMMdd" locale:@""], [Utilities stringFromDate:endDate withFormat:@"YYYYMMdd" locale:@""]]; + NSString *url = [kServerAddress stringByAppendingFormat:@"api/history/detail/%@/%@", [Utilities stringFromDate:startDate withFormat:@"YYYYMMdd" locale:@""], [Utilities stringFromDate:endDate withFormat:@"YYYYMMdd" locale:@""]]; NSLog(@"requestHistoryList link %@", url); [self _request:url method:@"GET" token:token paras:nil completion:^(NSData *data, NSError *error) {