我有四个不同的单元格,我试图向其中添加图像,每次更改图像时,它都会将图像添加到每个单元格中。我正在尝试为每个单元格添加单独的图像,但我不知道该怎么做。任何帮助都会很棒!这是我的代码:
if ([singletonObj.tempChangelistColor isEqualToString:@"red"]) {
self.layer.contents = (id)[UIImage imageNamed:@"red.png"].CGImage;
}else if([singletonObj.tempChangelistColor isEqualToString:@"yellow"]){
self.layer.contents = (id)[UIImage imageNamed:@"yellow.png"].CGImage;
}else if([singletonObj.tempChangelistColor isEqualToString:@"green"]){
self.layer.contents = (id)[UIImage imageNamed:@"green.png"].CGImage;
}else{
self.layer.contents = (id)[UIImage imageNamed:@"shop_deal.png"].CGImage;
}
它位于shop_deal.png的代码底部。