XCode 5 app crashes in 10.7

This app does nothing. And I mean: NOTHING

Created a new project in XCode 5.0. Changed the size of the window, removed resize, close options, etc

Deployment target is 10.7

copy the app over to my 10.7 VM and I get:

22/10/2013 11:06:28.579 talagent: kCGErrorIllegalArgument: CGSBindSurface: Invalid window 0x22
22/10/2013 11:06:32.761 [0x0-0x16016].com.acme.changePW: objc[195]: Object 0x10e81d8f0 of class NSPathStore2 autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
22/10/2013 11:06:32.761 [0x0-0x16016].com.acme.changePW: objc[195]: Object 0x10e81dc20 of class NSPathStore2 autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
22/10/2013 11:06:32.781 [0x0-0x16016].com.acme.changePW: objc[195]: Object 0x10e824710 of class __NSArrayM autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
22/10/2013 11:06:32.781 [0x0-0x16016].com.acme.changePW: objc[195]: Object 0x10e824a20 of class __NSCFString autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
22/10/2013 11:06:33.237 changePW: Unable to load nib file: MainMenu, exiting
22/10/2013 11:06:33.450 com.apple.launchd.peruser.502: ([0x0-0x16016].com.acme.changePW[195]) Exited with code: 1

This, incidentally, is what I get for an existing app that, prior to XCode 5, was working just fine.

Any ideas?

What OS are you building it on? Are you using ARC or garbage collection?

XCode 5.0
Mac OS 10.8.4

Just to check my sanity, I’ve gone to file > new > project

changed the deployment target to 10.7

built the project : it whines:

copy the resulting app over to 10.7.5 VM

run

it crashes and I get:

23/10/2013 09:41:38.974 [0x0-0x22022].com.acme.test107: objc[351]: Object 0x10da1d830 of class NSPathStore2 autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
23/10/2013 09:41:38.974 [0x0-0x22022].com.acme.test107: objc[351]: Object 0x10da1dac0 of class NSPathStore2 autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
23/10/2013 09:41:38.999 [0x0-0x22022].com.acme.test107: objc[351]: Object 0x10da22850 of class __NSArrayM autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
23/10/2013 09:41:38.999 [0x0-0x22022].com.acme.test107: objc[351]: Object 0x10da24b90 of class __NSCFString autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
23/10/2013 09:41:39.485 test107: Unable to load nib file: MainMenu, exiting
23/10/2013 09:41:39.777 com.apple.launchd.peruser.502: ([0x0-0x22022].com.cisco.test107[351]) Exited with code: 1

With regards to your last question:

Apple LLVM 5.0 - Language - Objective C
Setting
Objective C Automatic Reference Counting Yes Yes Yes No (for OS X default)

You can’t use ARC for ASObjC apps you want to run under anything earlier than 10.8 – you have to use garbage collection.

I’d like to add:

the first whining error message indicates, that Base Localization “ a comfortable new feature to localize apps in cooperation with Autolayout - is not available in Lion

But you have to use ARC for 10.9, correct?

No. You may have to use ARC to use some of the (unspecified) new-to-Mavericks APIs – but that would mean a 10.9-only app anyway.

However, I could have a conditional build setting, that, theoretically uses Garbage Collection for 10.7 and ARC for 10.8+ ?

No. There are theoretical methods using fat binaries, one version 32-bit, and some Info.plist fiddling, but I’ve never tried it.

How do I switch an existing project? I just wrote mine with the default settings and it won’t run on 10.7; I expect for the reasons you mentioned.

I went into Project → basic. Under Apple LLVM 5.1 Language Object C. I changed Objective-C Automatic Reference Counting from Yes to No.

Something else I need to do?
-t-

Yes, there are several other steps. You need to use Xcode 5.0.2 or earlier. You also need to change the deployment version, and add a new manual build setting to enable garbage collection. And you have to make sure the build settings for the .xibs is correct, Base Localization is off, and Auto Layout is off.

Shameless plug: there’s a full checklist in the the latest edition of my book.