0

Is it possible to link a third party framework, so that if it can't be found it is simply not linked? I tried adding -weak_framework MyFramework to the Other Linker Flags, but that seems to be used for Apple's frameworks only. I still get missing framework linking error.

The framework is a debug helper framework that allows view hierarchy inspection at runtime. However, I don't want to commit this framework to the repository and I want the app to simply run without it, if it is not found. There is not a single line in the app itself that depends on code from the framework.

Jawap
  • 2,463
  • 3
  • 28
  • 46

1 Answers1

4

There is not. -weak_framework allows the framework to be absent at runtime, but requires it to be present at build time.

One solution is to dynamically load the framework at runtime if it is present. Use NSBundle or dlopen() to do that. (Note that you shouldn't ship with that in place.)

Greg Parker
  • 7,972
  • 2
  • 24
  • 21