Difference between static and dynamic library in Xcode for iPhone

prajakta picture prajakta · Sep 16, 2010 · Viewed 7.2k times · Source

What is the difference between a static and dynamic library in XCode? And why doesn't Apple allow us to use dynamic libraries in our iOS applications?

Answer

jer picture jer · Sep 16, 2010

While you can build dynamic libraries for Mac OS X, you cannot use them for iPhone development.

A static library is merely an archive of object files that gets pulled into a program linking against it. The linker will unarchive all the archive files, and pull them in during linking along with the rest of your object files.

A dynamic library however, creates a shared object file, akin to a program but without an entry point, which programs can link against and call out of themselves into these shared libraries for their symbols, without pulling them into itself.