myImageView.hidden will not hide

Discussion in 'iPhone/iPad Programming' started by John Baughman, Oct 17, 2009.

  1. macrumors member

    Joined:
    Oct 27, 2003
    #1
    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
     
  2. thread starter macrumors member

    Joined:
    Oct 27, 2003
    #2
    oooops. After posting I noticed the error in my code snippet. the else line should be safariIcon.hidden = NO not safariIcon.alpha = NO.
     
  3. thread starter macrumors member

    Joined:
    Oct 27, 2003
    #3
    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
     

Share This Page