title: How do I include images into a library in iOS/Xcode 4
body: <p>I have an Xcode workspace with a couple of projects, say Foo and Baz, that both depend on some common code, which happens to be the RCSwitch switch button code (can be found <a href="http://osiris.laya.com/projects/rcswitch/">here</a> if anyone is interested). RCSwitch comes with a few image files that need to be loaded when Foo or Baz are running. They get loaded using the UIImage imageNamed: message, like so</p>
  
  <pre><code>UIImage *knobTmpImage = [[[UIImage imageNamed:@"btn_slider_thumb.png"] retain] autorelease];
  </code></pre>
  
  <p>My understanding is that for that to work the images need to be part of the application bundle. My question is how to get them there from within my library? I have tried adding the "Copy Bundle Resources" build phase to my library project and then adding all the images to that without any effect. The images do not get found at runtime.</p>
  
  <p>Then I tried adding the images to the "Copy Bundle Resources" build phase of Foo and Baz themselves; one has to select "Add Others" as the upcoming dialog does not list any resources outside the current project. That actually works, but it does seem like a weird way of doing it. Neither Foo nor Baz ought to have knowledge of the internals of the library. What if I wanted to ship the library to external customers?</p>
  
  <p>Is there another way of doing this? Is it even possible to have images or other resources in a libXXX.a file?</p>