Although Xcode 4 is advertised being aware of cross-project classes of projects in a shared workspace, I didn't find this working and did some research about the problem. The common solution discussed in many threads around here is, to create a static library and link your projects against it.
I therefore followed Jonah's guide (http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/) and created a static library to share frequently used subclasses of UIView with multiple projects.
With some trial and error experience and troubleshooting, I found this solution really satisfying and clean, but there are still some complications:
(1) A static library is unable to share XIB files
After the research I did, it seems impossible to access XIB files from outside the static library project without including them by dragging them into every project they are needed to create references. Given a UIViewController subclass in the static library which should be loaded from a XIB - although the UIViewController subclass is accessible from any project that links against the static library, you can't call 'initWithNibName' without adding the XIB file to that project.
I temporally solved this issue just by creating references to the XIB files of the static library in every project I need them - is there a better solution?
(2) Interface Builder isn't aware of classes in a static library
Although I can select one of the subclasses of UIView in my static library as the class of an object I dragged into an XIB in my project (even with autocompletion), I get an error at runtime saying "Unknown class [UIViewSubclassName] in Interface Builder file".
The solution I found here - Interface Builder can't see classes in a static library - (dragging the header file into the XIB-Browser to make Interface Builder recognize the class) apparently stopped working with the new Xcode 4 - the XIB-Browser is merged into the single-window-interface and doesn't respond to header files being dragged into it.
How can I make my XIB include objects from a static library (e.g. a UIViewController subclass in my project that should contain some buttons I frequently use and therefore included in my static library) without throwing exceptions at runtime?
Thank you very much!
PS: Some of these errors occur with code that compiles for the simulator without issues, but throw errors when building for the device...