Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone + OSX targets on the same project

I created a project with two targets, one for iPhone and another for Mac OsX. They both build and run well when I build them the first time (I built the OsX target first then iPhone target next). However, if I build the iPhone target and switch back to OsX target, the OsX target now thinks that it uses the iPhone SDK rather than it's own mac OsX SDK, and doesn't compile anymore (can't find the OSX SDK header files).

My build settings of the project and targets are setup correctly and the ".pbxproj" file is not changed in the process of switching targets. But I tracked down the problem to the ".pbxuser" file, specifically in the parameter "activeSDKPreference =".

Basically when I switch to iPhone target this parameter gets changed from macosx10.6 to iphonesimulator4.0, but when I switch back to OsX target it stays on iphonesimulator4.0. The only way to get it to work again is to close the project, manually change that param to macosx10.6, and reopen the project. This would solve it until I switch to iPhone again.

Is it a bug in XCode? anyone has a solution or a work around?

like image 508
Auday Avatar asked Sep 13 '10 06:09

Auday


1 Answers

The same question is asked and answered at http://lists.apple.com/archives/xcode-users/2010/Oct/msg00132.html

It says there: "you can Opt-Click your "Overview" combo box ([in the] Xcode Project [window], in the toolbar). You should see a more complete list of Active SDKs; pick an explicit OSX SDK".

like image 95
Justin Avatar answered Sep 27 '22 23:09

Justin