Skip to content

Commit

Permalink
修复一些warning
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnWong committed Jan 21, 2015
1 parent bdc8d79 commit 7da20fe
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions BusRider/Controller/JWBusLineViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ - (void)updateBusInfo {
case JWBusStateNotStarted:
self.mainLabel.text = @"--";
self.unitLabel.text = @"";
self.updateLabel.text = self.busInfoItem.pastTime < 0 ? @"上一辆车发出时间不详" : [NSString stringWithFormat:@"上一辆车发出%ld分钟", self.busInfoItem.pastTime];
self.updateLabel.text = self.busInfoItem.pastTime < 0 ? @"上一辆车发出时间不详" : [NSString stringWithFormat:@"上一辆车发出%ld分钟", (long)self.busInfoItem.pastTime];
break;
case JWBusStateNotFound:
self.mainLabel.text = @"--";
Expand All @@ -193,7 +193,7 @@ - (void)updateBusInfo {
break;
case JWBusStateNear:
if (self.busInfoItem.distance < 1000) {
self.mainLabel.text = [NSString stringWithFormat:@"%ld", self.busInfoItem.distance];
self.mainLabel.text = [NSString stringWithFormat:@"%ld", (long)self.busInfoItem.distance];
self.unitLabel.text = @"";
} else {
self.mainLabel.text = [NSString stringWithFormat:@"%.1f", self.busInfoItem.distance / 1000.0];
Expand All @@ -202,7 +202,7 @@ - (void)updateBusInfo {
self.updateLabel.text = [NSString stringWithFormat:@"%@前报告位置", [JWFormatter formatedTime:self.busInfoItem.updateTime]];
break;
case JWBusStateFar:
self.mainLabel.text = [NSString stringWithFormat:@"%ld", self.busInfoItem.remains];
self.mainLabel.text = [NSString stringWithFormat:@"%ld", (long)self.busInfoItem.remains];
self.unitLabel.text = @"";
self.updateLabel.text = [NSString stringWithFormat:@"%@前报告位置", [JWFormatter formatedTime:self.busInfoItem.updateTime]];
break;
Expand Down
2 changes: 1 addition & 1 deletion BusRider/Controller/JWStopTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
leftStopDesc = @"尚未发车";
break;
default:
leftStopDesc = [NSString stringWithFormat:@"%ld", lineItem.leftStops];
leftStopDesc = [NSString stringWithFormat:@"%ld", (long)lineItem.leftStops];
break;
}
[cell setTitle:[NSString stringWithFormat:@"%@", lineItem.lineNumer]
Expand Down
2 changes: 1 addition & 1 deletion BusRider/Item/BusLine/JWBusItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@implementation JWBusItem

- (void)setFromDictionary:(NSDictionary *)dict {
self.arrived = dict[@"arrived"];
self.arrived = [dict[@"arrived"] boolValue];
self.order = [dict[@"order"] integerValue];
self.distance = [dict[@"distance"] integerValue];
self.lastTime = [dict[@"lastTime"] integerValue];
Expand Down
2 changes: 1 addition & 1 deletion BusRider/View/JWStopNameButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ - (void)setIndex:(NSInteger)index title:(NSString *)title last:(BOOL)isLast toda
} else {
self.separator.hidden = NO;
}
self.indexLabel.text = [NSString stringWithFormat:@"%ld", index];;
self.indexLabel.text = [NSString stringWithFormat:@"%ld", (long)index];;
[self.titleButton setTitle:title forState:UIControlStateNormal];

[self setIsToday:isToday];
Expand Down
2 changes: 1 addition & 1 deletion Common/Item/JWFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ + (NSString *)formatedLineNumber:(NSString *)lineNumber {
}

+ (NSString *)formatedTime:(NSInteger)time {
return [NSString stringWithFormat:@"%ld%@", time < 60 ? time : time / 60, time < 60 ? @"" : @""];
return [NSString stringWithFormat:@"%ld%@", (long)(time < 60 ? time : time / 60), time < 60 ? @"" : @""];
}

@end
2 changes: 1 addition & 1 deletion Common/Model/JWRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ - (void)loadWithCompletion:(JWCompletion)completion progress:(JWProgress)progres
completion(nil, error);
};
self.request.downloadProgressBlock = ^(NSData *data, NSUInteger totalBytesReceived, long long totalBytesExpectedToReceive) {
NSLog(@"JWRequest: progress %ld / %lld", totalBytesReceived, totalBytesExpectedToReceive);
NSLog(@"JWRequest: progress %ld / %lld", (unsigned long)totalBytesReceived, totalBytesExpectedToReceive);
if (progress) {
progress(totalBytesReceived * 100 / totalBytesExpectedToReceive);
}
Expand Down
6 changes: 3 additions & 3 deletions Today/View/JWBusCardView.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ - (void)setItemInternal:(JWBusInfoItem *)item {
case JWBusStateNotStarted:
self.mainLabel.text = @"--";
self.subLabel.text = @"";
self.updateLabel.text = item.pastTime < 0 ? @"上一辆车发出时间不详" : [NSString stringWithFormat:@"上一辆车发出%ld分钟", item.pastTime];
self.updateLabel.text = item.pastTime < 0 ? @"上一辆车发出时间不详" : [NSString stringWithFormat:@"上一辆车发出%ld分钟", (long)item.pastTime];
break;
case JWBusStateNotFound:
self.mainLabel.text = @"--";
Expand All @@ -102,7 +102,7 @@ - (void)setItemInternal:(JWBusInfoItem *)item {
break;
case JWBusStateNear:
if (item.distance < 1000) {
self.mainLabel.text = [NSString stringWithFormat:@"%ld", item.distance];
self.mainLabel.text = [NSString stringWithFormat:@"%ld", (long)item.distance];
self.subLabel.text = @"";
} else {
self.mainLabel.text = [NSString stringWithFormat:@"%.1f", item.distance / 1000.0];
Expand All @@ -111,7 +111,7 @@ - (void)setItemInternal:(JWBusInfoItem *)item {
self.updateLabel.text = [NSString stringWithFormat:@"%@前报告位置", [JWFormatter formatedTime:item.updateTime]];
break;
case JWBusStateFar:
self.mainLabel.text = [NSString stringWithFormat:@"%ld", item.remains];
self.mainLabel.text = [NSString stringWithFormat:@"%ld", (long)item.remains];
self.subLabel.text = @"";
self.updateLabel.text = [NSString stringWithFormat:@"%@前报告位置", [JWFormatter formatedTime:item.updateTime]];
break;
Expand Down

0 comments on commit 7da20fe

Please sign in to comment.