2

I created a static library (framework) using the following tutorial https://github.com/jverkoey/iOS-Framework.

The size of the framework is huge - about 220 MB.

When I instead create a dynamic embedded framework , the size is only ~12MB.

Important to note that the framework is distributed as a binary.

Some of the code is written in c++ and objc++.

The linker flags in both projects are identical:

OTHER_LDFLAGS = $(inherited) -ObjC -l"c++"

What is causing this huge variance in size? How do I bring down the size of the static library to be the same as the embedded dynamic library?

Avba
  • 14,822
  • 20
  • 92
  • 192

1 Answers1

0

I feel this blog post answers this question directly (and at length). The short answer is that a static library is copied in its entirety into the binary. A dynamic framework only loads the code that is needed at load and runtime. Depending on the, well, dependencies, this could account for a huge variance indeed.

AmitaiB
  • 1,656
  • 1
  • 19
  • 19