title: How can I load an image in my resources folder?
body: <p>I have an image in my iPhone Project. It's a PNG and I can set the background in Interface Builder but I want to do this programatically.</p>
  
  <pre><code>NSLog(@"Before %@", myEasterEgg);
  uiImageBackground.backgroundColor = [UIColor purpleColor];
  myEasterEgg = [myEasterEgg stringByAppendingString:@"5"];
  NSLog(@"After %@", myEasterEgg);
  if (CFStringCompare((CFStringRef)myEasterEgg, (CFStringRef)@"52235", 1) == 0) {
      myEasterEgg = @"";
      uiImageBackground.backgroundColor = [UIColor clearColor];
      [uiImageBackground setImage:[UIImage imageNamed:@"dock.png"]];
      uiImageBackground.image = image;
  }
  [myEasterEgg retain];
  NSLog(@"After %@", myEasterEgg);
  </code></pre>
  
  <p>The above is the code in my button. It doesn't display the dock.png file.</p>
  
  <p>UPDATE. I'VE MODIFIED THE CODE SO THE IF STATEMENT WILL ALWAYS EXECUTE AND IT STILL DOESN'T LOAD THE IMAGE. MODIFIED CODE BELOW!</p>
  
  <pre><code>NSLog(@"Before %@", myEasterEgg);
  uiImageBackground.backgroundColor = [UIColor purpleColor];
  myEasterEgg = [myEasterEgg stringByAppendingString:@"5"];
  NSLog(@"After %@", myEasterEgg);
      myEasterEgg = @"";
      uiImageBackground.backgroundColor = [UIColor clearColor];
      [uiImageBackground setImage:[UIImage imageNamed:@"dock.png"]];
      uiImageBackground.image = image;
  [myEasterEgg retain];
  NSLog(@"After %@", myEasterEgg);
  </code></pre>