自定义一个tableview 后不显示数据,我排查了连接 委托是否有问题后,发现一切正常,后来看了下代码,发现我copy 的标识符GoodsCarTableViewCell 后面有了一个
空格,我把空格除去果断出现想要的数据,真是马虎呀。
GoodsCarTableViewCell *cell = (GoodsCarTableViewCell*) [tableView dequeueReusableCellWithIdentifier:@"GoodsCarTableViewCell 此处有空格 "]; 错误
正确
GoodsCarTableViewCell *cell = (GoodsCarTableViewCell*) [tableView dequeueReusableCellWithIdentifier:@"GoodsCarTableViewCell"]; 后面无空格正确。