I have an Xcode workspace with several projects, say Foo and Baz, which both depend on some common code, which happens to be the code of the RCSwitch toggle button (can be found here if anyone is interested). RCSwitch comes with several image files that you must download when you start Foo or Baz. They are loaded using the UIImage imageNamed message: so
UIImage *knobTmpImage = [[[UIImage imageNamed:@"btn_slider_thumb.png"] retain] autorelease];
I understand that in order to work, images must be part of the application package. My question is how to get them there from my library? I tried to add the โCopy Bundle Resourcesโ build phase to my library project and then add all the images to this without any effect. Images are not detected at runtime.
Then I tried to add images to the "Copy Bundle Resources" build phase for Foo and Baz; you need to select "Add others" because the dialog box does not list resources outside the current project. It really works, but it seems like a weird way to do it. Neither Fo nor Baz should have knowledge of the internal library. What if I want to send the library to external clients?
Is there any other way to do this? Is it possible to have images or other resources in the libXXX.a file?
source share