// 拉伸
self.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg_dealcell"]];
// 平铺
self.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg_dealcell"]];
保留两位小数
// 现价
self.currentPriceLabel.text = [NSString stringWithFormat:@"¥ %@", deal.current_price]
NSUInteger dotLoc = [self.currentPriceLabel.text rangeOfString:@"."].location
if (dotLoc != NSNotFound) {
// 超过2位小数
if (self.currentPriceLabel.text.length - dotLoc > 3) {
self.currentPriceLabel.text = [self.currentPriceLabel.text substringToIndex:dotLoc + 3]
}
}
- (BOOL)isEqual:(MTDeal *)other
{
return [self.deal_id isEqual:other