title: Objective C. What's wrong with this UIButton image?
body: <p>I have a set of UIButtons mapped out in IB. I want to randomly add images to a few buttons for each round of an education game.</p>
  
  <p>You can see some images stashed at the top of the page:</p>
  
  <p><img src="https://i.stack.imgur.com/iCV5K.png" alt="enter image description here"></p>
  
  <p>As you can also see, the images in the buttons are blue. So, what am I doing wrong (i.e. why are they blue?)? Are they being set as background images?</p>
  
  <p>I'm adding the images as follows:</p>
  
  <pre><code>    int tmpTag0 = [[currentButtonArray objectAtIndex:0] integerValue];
      UIButton *tmpButton0 = (UIButton *)[self.view viewWithTag:tmpTag0];
      [tmpButton0 setImage:[UIImage imageNamed:temp1] forState:UIControlStateNormal];
  
  ........
  
      int tmpTag4 = [[currentButtonArray objectAtIndex:4] integerValue];
      UIButton *tmpButton4 = (UIButton *)[self.view viewWithTag:tmpTag4];
      [tmpButton4 setImage:[UIImage imageNamed:temp5] forState:UIControlStateNormal];
  </code></pre>
  
  <p>currentButtonArray is an array of 5 random button indexes that correspond to 5 button tags. </p>
  
  <p>Thanks very much for any ideas.</p>
  
  <p>What I'm seeing when I look for UIButton in Xcode help:</p>
  
  <p><img src="https://i.stack.imgur.com/4KKD2.png" alt="enter image description here"></p>
  
  <p>UPDATE: 
  With help from folks below, this worked for me:</p>
  
  <pre><code>int tmpTag0 = [[currentButtonArray objectAtIndex:0] integerValue];
  UIButton *tmpButton0 = (UIButton *)[self.view viewWithTag:tmpTag0];
  UIImage *buttonImage0 = [UIImage imageNamed:temp1];
  buttonImage0 = [buttonImage0 imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
  [tmpButton0 setImage:buttonImage0 forState:UIControlStateNormal];
  </code></pre>