myImageView.hidden will not hide

Discussion in 'iOS Programming' started by John Baughman, Oct 17, 2009.

  1. John Baughman macrumors regular

    Oct 27, 2003
    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.


  2. John Baughman thread starter macrumors regular

    Oct 27, 2003
    oooops. After posting I noticed the error in my code snippet. the else line should be safariIcon.hidden = NO not safariIcon.alpha = NO.
  3. John Baughman thread starter macrumors regular

    Oct 27, 2003
    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!


Share This Page