I'm trying to compile for 64 and 32 bit. I followed the instructions in Apple's transition guide:
and changed my architectures setting. If I changed Build Active Architecture Only
to Yes
, I get an error saying the architecture is not available. With it set to the settings below, it compiles successfully in the 64-bit iPhone simulator, but when I check it using the following block of code, it says it's still running 32-bit.
How do I properly set this up to run as 64-bit on 64-bit devices, and 32-bit on 32-bit devices?
#if __LP64__
NSLog(@"64");
#else
NSLog(@"32");
#endif
Set "valid architectures" to arm64, armv7 and armv7s (and i386, which is for the simulator) and you should be good to go.
It looks like, from your screenshot, that "Architectures" is already set correctly (to "Standard architectures").
If I set up a test project and drop those NSLog lines in and run them in the 64-bit iPhone simulator, I'll see "64
" print out in the Xcode console.