• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "iOS Static Libraries Are, Like, Really Bad, And Stuff (Radar 15800975)"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "iOS Static Libraries Are, Like, Really Bad, And Stuff (Radar 15800975)"


  • Subject: Re: "iOS Static Libraries Are, Like, Really Bad, And Stuff (Radar 15800975)"
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 20 Jan 2014 16:58:32 -0800


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
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: "iOS Static Libraries Are, Like, Really Bad, And Stuff (Radar 15800975)"
      • From: email@hidden
References: 
 > "iOS Static Libraries Are, Like, Really Bad, And Stuff (Radar 15800975)" (From: Jens Alfke <email@hidden>)
 >Re: "iOS Static Libraries Are, Like, Really Bad, And Stuff (Radar 15800975)" (From: email@hidden)

  • Prev by Date: Re: "iOS Static Libraries Are, Like, Really Bad, And Stuff (Radar 15800975)"
  • Next by Date: Re: "iOS Static Libraries Are, Like, Really Bad, And Stuff (Radar 15800975)"
  • Previous by thread: Re: "iOS Static Libraries Are, Like, Really Bad, And Stuff (Radar 15800975)"
  • Next by thread: Re: "iOS Static Libraries Are, Like, Really Bad, And Stuff (Radar 15800975)"
  • Index(es):
    • Date
    • Thread