title: iPhone: Change custom button graphic
body: <p>I need to programmically change the graphic for a custom button and I'm puzzled why the code below isn't working.  I can uncomment the first line and hide the button, so the IBOutlet is connected. The variable cardString points to a valid image (0-51.jpg).</p>
  
  <pre><code>    //[c1 setHidden: YES];
     cardString = [NSString stringWithFormat:@"%d%s", cards[0],".jpg"];
     card = [UIImage imageNamed: cardString];
     [c1 setBackgroundImage:card forState:UIControlStateNormal];
     NSLog(cardString);   
  </code></pre>