I have an NSString
category class (NSString+URLEncoding.h
).
I am running into and unknown selector crash, because the string I am calling the categ
There's an issue with the linker that can cause its dead-code stripping to completely omit any object files that only contain obj-c categories (or that are otherwise unreferenced). Theoretically passing the -ObjC
flag to the linker should fix this, but that doesn't seem to always work. You can work around this issue by providing the -all_load
linker flag, which will cause the linker to always link in all object files.
Note that you might have to set -all_load
on the parent project if your category is part of a sub-project or library that you-re including somewhere.
Update: I believe -ObjC
is reliable now and has been for years so you can stop using -all_load
for this issue.