tableViewCell刷新问题
关于tableViewCell显示不全,导致priceLabel并没有得到刷新。进入下一页面时self.price= 默认值,而不是添加
比方说,iPhone界面是绿色部分,tableViewCell能显示的刚好到儿童票(iphone 5s)页面如下:
之前刷新price的代码是这样的,在选择票的cell上刷新priceCell,就可以了。priceCell这边就会处理总价格
[self.buyTicketTableView beginUpdates];
[self.buyTicketTableView reloadSections:[NSIndexSet indexSetWithIndex:PGOfferEventBuyTicketTableViewCellTotalPrice] withRowAnimation:UITableViewRowAnimationNone];
[self.buyTicketTableView endUpdates];
而5s界面刚好priceCell的页面没显示出来,别人有时候选完,不会下拉看看价格的,直接跳转付款页面,导致priceCell没有出现,不出现的话,使用上面的代码是不行的。
必须是选完数量,马上算。。。。
在选择票的cell上加上就可以了
self.totalPrice = 0;
if ([self.purchaseItemList count] != 0) {
for (NSMutableDictionary *dict in self.purchaseItemList) {
self.totalPrice += [[dict objectForKey:@"price"] doubleValue] * [[dict objectForKey:@"quantity"] doubleValue];
}
}