Ios 自定义表格视图单元格显示为空(标签为零)
我在应用程序中使用的代码与我在其他表中使用的代码相同,但我缺少一些东西。正如您在此图像中所看到的,没有设置我的任何标签Ios 自定义表格视图单元格显示为空(标签为零),ios,objective-c,ios7,Ios,Objective C,Ios7,我在应用程序中使用的代码与我在其他表中使用的代码相同,但我缺少一些东西。正如您在此图像中所看到的,没有设置我的任何标签 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { CommissionsCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Commissi
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CommissionsCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CommissionsCell"];
CommissionInfo* tmpInfo = [g_commissionList objectAtIndex:[indexPath row]];
cell.backgroundColor=[UIColor colorWithWhite:0.95 alpha:1 ];
cell.lblDescription.text = tmpInfo.description;
cell.lblDate.text = tmpInfo.date;
cell.lblStatus.text = tmpInfo.status;
if([tmpInfo.imgThumbPath isEqualToString:@""]){
cell.lblInstructions.hidden=NO;
}else{
cell.lblInstructions.hidden=YES;
}
[cell.btnImg setImage:tmpInfo.img_thumb];
return cell;
}
我把我所有的标签都映射到commissioncell.h文件中了知道是什么原因吗
你是否使用故事板?你的标签是否正确连接/实例化?你在哪里制作你的单元格视图?另外,您是否注册了该类?如果您使用的是Storyboard,那么单元格需要正确连接才能实例化如果您不使用Storyboard,那么您需要以编程方式实例化单元格[alloc and init]。我的意思是使用registerClass:forCellReuseIdentifier:,这是您不应该做的,如果你在故事板上制作了你的手机。