I have created a static library to house some of my code like categories.
I have a category for UIViews in \"UIView-Extensions.h\" named Extensions.
In this
The only solution that worked was to include:
"-all_load"
in other linker flags.
EDIT: Be sure to add this flag to the project including the static library, not to the static library itself.
I know this isn't the correct method, but it is working for now.
It maybe a OS 3.0 issue since this was the work around for Three20 as well.
If you are on Xcode 3.2 you can avoid using -all_load and instead use -force_load for just the library in question, which should be slightly more efficient.
This is described in a recently updated Apple Technical QA: http://developer.apple.com/mac/library/qa/qa2006/qa1490.html
I ran into this problem recently. I was unable to get the -all_load to work, when I noticed that another category I had DID work. I was lazy for this category and included it in with another file.
I eventually created a dummy class (no methods, instance variables) and included the implementation of my categories in the .m file for that dummy class. After doing this my categories started working even after I removed the -all_load flag.
This was on iPhone OS 3.1.3.
This certainly is not the RIGHT way to fix it, but it seemed to work.
Full sample code is on my blog for my (trivial) categories.
I just had this same problem but adding any combination of the described flags (-ObjC, -all_load, -force_load) did not work.
It turned out that I had not checked the box "Add to Target" when adding the files to the project. I removed the files from the project and added them again, this time making sure that that box was checked. This fixed the problem.
In the past I was able to force linkage of the category with -u .objc_category_name_UIView_Extensions, but with the 3.0 dev environment that's broken and the only option seems to be -all_load.
I had the same problem with Categories in my static library. In my case, "-all_load" didn't help as it caused loads of build errors (my static library is a wrapper around another private C/C++ lib).
I solved it by a hack suggested at http://iphonedevelopmentexperiences.blogspot.com/2010/03/categories-in-static-library.html which simply involved adding a dummy (empty) class definition to the category files. Using this hack, I kept "-ObjC" but dropped "-all_load" in the application linker settings and it worked fine on the device.