当我重新加载NSTableView
单元格的图像视图时被覆盖。如何从可可的超级视图中删除图像视图?
我试过下面的代码:
NSImageView *tabIconImageview1=[[NSImageView alloc]initWithFrame:NSMakeRect(45, 12, 40, 40)];
[tabIconImageview removeFromSuperviewWithoutNeedingDisplay];
[tabIconImageview removeFromSuperview];
if ([strFilenames hasSuffix:@"."])
{
[tabIconImageview1 setImage:[NSImage imageNamed:@"fileicon"]];
//tabIconImageview1.image=[NSImage imageNamed:@"fileicon"];
}
else if ([strFilenames hasSuffix:@".exe"])
{
[tabIconImageview1 setImage:[NSImage imageNamed:@"exeicon"]];
}
else if ([strFilenames hasSuffix:@"png"])
{
[tabIconImageview1 setImage:[NSImage imageNamed:@"imageicon"]];
}
else if ([strFilenames hasSuffix:@".zip"])
{
[tabIconImageview1 setImage:[NSImage imageNamed:@"zipicon"]];
}
else //if ([strFilenames hasSuffix:@"."])
{
[tabIconImageview1 setImage:[NSImage imageNamed:@"foldericon"]];
}
[cellView addSubview:tabIconImageview1];
看我的截图,图像重叠。我怎样才能在可可中阻止它?