Categories
iphone

How to make an iPhone static library – part 2

UPDATE: Apple changed everything (again) without telling developers (again) and broke everything (again).

Current versions of Xcode (the minimum that Apple allows you to use) will *not* work with the architecture-link part of this blog post.

Instead, see this StackOverflow question I asked (and answered) with an updated technique: http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4

Intro

This is NOT a perfect way of doing static libs on iPhone; however, it does work – I’ve used it in iPhone apps that are on the App Store right now – and I’ve been sitting on this post for over a month, improving it, tweaking it. It’s not perfect, but I think it’s better to put it out onto Google than to keep it quiet any longer.

NB: I’m not a Mac developer; the iPhone is relatively new to me. I apologize in advance for any stupid mistakes I make here where I should have known better!

PS: If you don’t read this blog normally, you might be dismayed at the amount of whinging about Apple’s less-than-perfect code and documentation in this post. Sorry. Let me just say that I am *trying* to be even-handed – and that that requires not only praising Apple, but also calling out their bad acts where relevant. I and many of my friends and ex-colleagues have suffered hours and days of wasted time – ON THIS TOPIC ALONE – because of tiny things that Apple staff “forgot to mention” or “didn’t bother testing”. It’s understandable, but it’s also painful.