我的应用程序中有一个带有自定义单元格的 UITableView。当用户选择一个单元格时,会显示一个详细的 View Controller 。回到 tableView 时,一个带有文本 Label 的标 checkout 现了大约 10 秒,然后消失了。
我在storyBoard中搜索过label,但找不到,但最奇怪的是,它只有在用户从detail viewController回到tableViewController时才会出现。
这是我正在谈论的图像:
欢迎任何关于如何检测代码中标签的想法。
更新**
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomCell *cell =[tableView dequeueReusableCellWithIdentifier:@"Cell"];
if (cell ==nil){
cell = [[CustomCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"];
}
cell.nombreEmpresaLabel.text = [[categorias objectAtIndex:indexPath.row] objectForKey:@"nombreEmpresa"];
cell.textLabel.textColor = [UIColor whiteColor];
cell.direccionEmpresaLabel.text= [[categorias objectAtIndex:indexPath.row] objectForKey:@"direccionEmpresa"];
NSMutableString *logo = [[NSMutableString alloc]initWithString:@"http://mujercanariasigloxxi.appgestion.eu/logos/"];
NSString *imageURL = [[categorias objectAtIndex:indexPath.row] objectForKey:@"strImagen"];
cell.meGustaHits.text = [[categorias objectAtIndex:indexPath.row] objectForKey:@"valoracionEmpresa"];
if(imageURL != nil && ![imageURL isEqual:[NSNull null]])
{
[logo appendString:imageURL];
NSURL *logoURL = [NSURL URLWithString:logo];
NSData *logoData = [NSData dataWithContentsOfURL:logoURL];
cell.logoImage.image = [UIImage imageWithData:logoData];
}
else{
cell.logoImage.image = [UIImage imageNamed:@"icono80"];
}
return cell;
}
如您所见,只有三个标签,一个是公司名称,一个是公司地址,第三个是显示数字。
最佳答案
有时很难在 Storyboard 上找到控制权。
在我看来,您添加它是偶然的。
如果您没有使用代码创建它,那么您应该在 Document outline
中看到它。的 Storyboard。
关于ios - tableView 上显示的奇怪标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22153524/