开发者

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?


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".


it is a bug in xCode, so you use the latest version of xCode


when you build this it set all your target. you can solve this by clean all target than build it. you wil find this in xcode build manu >> clean all target. than build this. it will work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜