这是代码
-(NSInteger)tableView:(UITableView )tableView numberOfRowsInSection:(NSInteger)section{
return 1; }
-(UITableViewCell)tableView:(UITableView )tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell cell =[tableView dequeueReusableCellWithIdentifier:@"ChecklizdvdzfbdzbstItem"]; return cell;
}
-(UITableViewCell * ) tableView:(UITableView * ) tableView cellForRowAtIndexPath:(NSIndexPath * ) indexPath{
static NSString * ID = @"ChecklizdvdzfbdzbstItem";
UITableViewCell * cell =[tableView dequeueReusableCellWithIdentifier:ID];
if (!cell) {
UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]
return cell;
}
独立写一下汽车品牌展示,发现了以下这个错。原来。。
static NSString *ID = @"car_cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
if (cell == nil) {
UITableViewCell *cell = [[......
答案就在这里:failed to obtain a cell from its dataSource
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。
cell 总要处理,添加一些信息等什么的