我有我的應用程序中的自定義單元格的UITableView。當用戶選擇一個單元格時,會顯示一個詳細的視圖控制器。回到tableView時,帶有文本標籤的標籤出現約10秒鐘,然後消失。 我已經在storyBoard中搜索了標籤,但是我找不到它,但最奇怪的是它僅在用戶從詳細視圖控制器返回到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;
}
正如你所看到的,只有三個標籤,一個公司名稱,一個是公司的地址和第三顯示的數字。
是您的tableViewController已在故事板定義的原型細胞? – Srikanth
是@Srikanth,它具有在StoryBoard中定義的ProtoType單元格。 – mvasco
我想你是以編程方式加載自定義單元格。嘗試從storyBoard中移除一次ProtoType單元格,並在您的StoryBoard中進行徹底檢查併爲任何UILabels編程。 – Srikanth