Can't make Xcode 4 run a barely empty project

2019-07-22 15:43发布

问题:

I created a blank NavBar project and only touched a couple lines or so on one of the view controllers. I tested it fine in the 4.3 iPad and iPhone emulator but can't make it work for 4.2 at all. I get an error saying:

The selected run destination is not valid for this action.

This is what I have on my project settings:

Usually in XCode 3 that was all I needed to change but I guess I'm missing some setting in XCode 4.

What could this be?

回答1:

@pokstad, you are right. I was looking at the wrong place indeed!

Choosing the target and changing the SDk there did the trick.

Thanks!



回答2:

I really had troubles with this and none of the hints helped. Finally I got an error message that pointed to an old file in the build folder, in the end a simple clean did resolve my issues (shift+cmd+K). It compiled fine. So remember to clean your current build after you changed the build settings in Xcode4. This may be obvious, but at that moment it wasn't obvious to me.