PDA

View Full Version : myImageView.hidden will not hide




John Baughman
Oct 17, 2009, 02:30 AM
I have a UIImageView in a UITableViewCell. In the TableViewController for the UITableView I am trying to set the image to hidden with myImageView.hidden = YES. As you can see in the code snippet, I have several UILabels in the cell which I am able to succesfully set at the same time, so I am pretty sure I have things wired correctly...


cell.displayNameLabel.text = person.displayName;
cell.lastStatusLabel.text = person.lastStatusMsg;
cell.url.text = person.webAddress;
if(cell.url.text == @""){
cell.safariIcon.hidden = YES;
}else {
cell.safariIcon.alpha = NO;
}




Any suggestions? I tried setting alpha to 0, but that did not work either. If I can't get it to hide, I figure I can set the image to a blank image.

Thanks,

John



John Baughman
Oct 17, 2009, 02:32 AM
oooops. After posting I noticed the error in my code snippet. the else line should be safariIcon.hidden = NO not safariIcon.alpha = NO.

John Baughman
Oct 17, 2009, 04:23 AM
OOPS!! again. I did not have the imageView outlet wired in interface builder. duhh!

All is working now.

How long does it take before you stop making these kinds of mistakes? I spend most of my time chasing my tail for things I should already know!

John