I have several projects which share many of the same classes and custom views/view controllers, so I created a custom static library which contain these common classes to be used directly in my client projects.
These are the steps I took:
I created and compiled the static library, copied the resulting .a and public .h files into a folder on my desktop (myLib).
I dragged-and-dropped the myLib folder into my client project. I copied by reference, and did not copy the physical files under my client project. The target's Build Phases "Link Binary With Libraries" phase automatically included the .a file, as expected.
I referenced the View Contollers using the story board for the client project. The classes autocompleted as expected, so Xcode recognizes their existence.
I set the -ObjC and -all_load Linker Flags under my client project build settings and target build settings.
I cleaned and built the client project successfully.
I ran the client project, but the custom view did not load, citing an "Unknown class [myViewController] in Interface Builder file".
Step 6 is the problem I'm facing right now. Here are some other observations that might be useful:
In the File Inspector, the headers' target membership is blank; the client project is listed under the Target Membership heading, but the checkbox is disabled and unchecked. The myLib.a target membership is selected, however.
I tried to make a subclass of myViewController (clientViewController) in the client project and reference this class instead. When I build the client project, I get an error:
"warning: directory not found for option '-L/Users/[me]/Desktop/Projects/[clientProject]/[myLib]; Undefined symbols for architecture i386: [clientViewController] in [clientViewController.o]."