On Jan 20, 2014, at 4:34 PM, Rick Mann < email@hidden> wrote: They make "static" frameworks, which Xcode inexplicably doesn't support directly.
A static framework is basically structured like a 'real' framework, but instead of a dylib it contains a static library with the ".a" suffix removed. Xcode happily links against these, but for some reason can't create them. However, you can coax Xcode into building them, and there are numerous examples of building them online. You can even make them universal binaries, so that they work for all the platforms, including the Simulator. You pretty much have to make a universal binary including an extra i386 (simulator) flavor, otherwise anyone building an app using the framework will find that they can't build or run their app on the simulator, which is generally unacceptable.
Creating the universal binary is a mess because it requires forcing Xcode to programmatically build your target multiple times for different platforms, then collecting and lipo'ing the output. The best mechanism I found came from a StackOverflow thread and uses a fairly complex shellscript that you set up as a build phase, that examines the build settings and then invokes xcodebuild to build the "other" platform. This works, but it's ugly, and it makes the whole build setup about 10x as complicated as it would have been otherwise, for gnarly reasons I won't go into here. Fortunately I don't have to mess with it often, but every time I do my heart sinks.
By comparison, building a fat framework for OS X is pretty trivial: you just tell Xcode which architectures you want and it builds everything multiple times and combines it for you.
—Jens |