I had completed an iPhone, and then decided to build an iPad version. So, upgrading to xCode 4, I decided to create a workspace with 3 projects – iPhone, iPad, and Common (cross-refernced static library). I then stripped all of the classes I was using in the iPhone project that I felt could be used in the iPad as well. I placed those “common” classes in my static library project.
My next step was to build and make sure my iPhone project still worked. After running the app, several of the methods that I’m calling that are now in the static library are failing – causing the app to crash, SIGBRT, etc.
Upon further investigation, I determined that all the methods that are failing or causing the crash are coming from either UI subclassed objects, or from UI extended objects. For example, one of my classes extends UITableView with a custom method. This causes a crash. Another method is from a custom subclass that inherits from UILabel. This also causes a crash.
All other objects/methods in the static library seem to be working fine. Does anyone have an idea what’s happening here? Do I need some extra build configuration setup in my project to get this to work? I can’t imagine I’m not allowed to use UI subclassing/extensions in my static library, but who knows…
Any help/insight would be appreciated…
Thanks!
Set -all_load in Linking in your Build Settings.