Thursday, November 3, 2011

Using Xcode 4.2 with iOS 3.x

It had been a while since testing on an iOS 3.1 device, or even an ARM6 device. Being that I had since switched to Xcode 4.2 and LLVM, everything was broken. It seemed by "fixing" one issue, I was causing another. It all started when I could not run my app on an Arm6 device...

Problem #1: ARMv7 has become a default

Depending on what you read there are a few solutions, but I found what worked the best was to make sure the 'Architectures' build settings look like this:


Note: 'Build Active Architecture Only' is set to 'NO' and 'armv6' was added to 'Architectures'. Great, but this will cause...

Problem #2: Crash on iOS 3.1.3

Something like: Symbol not found: __NSConcreteStackBlock

Adding a linker flag will do the trick, see here: Solution on Stack Overflow

This will in turn cause....

Problem #3: Crash in Simulator on Game Center Authenticate

Luckily we do not need our new linker flag for the simulator so we can make the flag conditional - excluded from simulator builds - as seen here:



Problem #4: Proper Architecture Conditional Build Settings

I am not 100% certain on this, but I don't feel the need to be. If you set conditional build settings on arch. (eg, THUMB, or Preprocessor Macros), the ARMv7 one will be ignored. So if you have a macro set up like so (pardon the formatting, Blogger's editor really is terrible):

> Preprocessor Macros
-Debug : MACRO1
----Armv7 : Arch MACRO2
----Armv6 : Arch MACRO3

On an Arm6 Device only MACRO3 will be defined (as expected), but on an Arm7 device, only MACRO1 will be defined. That is my current experience anyway. So use caution.

1 comments:

  1. Would you consider dropping support for older versions, or do you want to have as much reach as possible?

    Might not be good for an established app, but new apps may be worthwhile with setting the minimum to 5.0.

    ReplyDelete