Question

I am using a third party framework and it was causing crashes due to an undefined selector. The vendor has told that I need to add all_load as a linker flag. It seems that this compiled library is injecting methods into UIViewController to handle certain unknown details. I am reluctant to use the all_load linker flag because it would load everything, which would bloat my app binary with not just everything from this library but every library. I am doing everything I can to keep the size of my app binary down so I have asked vendor to eliminate this requirement as well as properties which are also declared in @protocols which require me to synthesize those properties in my implementation. This library breaks encapsulation by leaking out so much critical details. I'd rather just have delegates and blocks do anything that needs to be done, but this library is using techniques that I consider harmful and actually causing the app to crash.

Does it make good sense to not require all_load as a linker flag or I am I being too picky? And is it not dangerous to allow a third party library to use categories to inject methods into objects like UIViewController, especially if there could be name collisions?

Was it helpful?

Solution

I also encountered the same problem. And I modify the third party library's source code, remove categories. Use -ObjC linker flag can cause name collisions, expecially if we create library that use other third party.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top