- 分组的tableview ,即UITableViewStyleGrouped.当每组只有一行时,你在从模型中取数据时候,一定是indexPath.section,而不是ndexPath.row,否则从模型中取出的数据都是第0行数据(每组只有一行),这样就会造成列表中的数据长得一模一样。
_listTableView = [[UITableView alloc] initWithFrame:CGRectMake(0,self.topNavgationView.zb_height + autoScaleH(80), APP_SCREEN_WIDTH,APP_SCREEN_HEIGHT - self.topNavgationView.zb_height - 44 - autoScaleH(80)) style:UITableViewStyleGrouped];
AS_ZBMessageModel *model = self.Marray[indexPath.section];
self.selectCurrentRow = indexPath.section;
- Plain样式的tableview,那么在从模型中取数据时候,一定要是indexPath.row。
_listTableView = [[UITableView alloc] initWithFrame:CGRectMake(0,self.topNavgationView.zb_height + autoScaleH(80), APP_SCREEN_WIDTH,APP_SCREEN_HEIGHT - self.topNavgationView.zb_height - 44 - autoScaleH(80)) style:UITableViewStylePlain];
AS_ZBMessageModel *model = self.Marray[indexPath.row];
self.selectCurrentRow = indexPath.section;