Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

John Baughman

macrumors regular
Original poster
Oct 27, 2003
100
0
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...

Code:
        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
 
oooops. After posting I noticed the error in my code snippet. the else line should be safariIcon.hidden = NO not safariIcon.alpha = NO.
 
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.