Here's the scenario - I have created a custom NSView subclass, and the implementation is in a static library. The class is never referenced from the final executable, only from the Interface Builder XML file. Since it's not referenced, it doesn't get included at link time, and as a result the class can't be found at runtime.
Is there any way to force it to be linked in, other thank link dynamically or compile the class directly into the executable itself?
You can use the class
class method on it, which will mostly be a no-op, but will reference it from your code.
int main(int argc, const char** argv)
{
[MyClass class]; // There you are! MyClass is now referenced from your code.
/* ... rest of your main function ... */
}