Changing images in cells for UITableViewController
I have four different cells that I am trying to add images to and every
time that I change the image it adds the image to each cell. I'm trying to
add separate images for each cell, but I'm not sure how to do it. Any help
would be great! Here's my code:
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;
}
It's at the bottom of the code with the shop_deal.png.
No comments:
Post a Comment