views:

65

answers:

1
+1  Q: 

Projects in XCode

Can i create a single project in XCode such that there are 2 targets, one using C++ and another using Objective-C??

+2  A: 

Yes, you can have as many targets as you like, and these can be of any kind. You can also mix languages however you like. You don't need to specify a language for a target though - language is determined by file suffix (although you can customise the behaviour of this).

For source files which need to be compiled for only one or a subset of targets you can use the inspector window targets tab to select which target(s) a given source file is associated with. Select file(s) => Get Info => Targets.

Paul R
Maybe you can add that you can choose what sources to add to which target? Might not be obvious to everyone.
Georg Fritzsche
@gf: good point - I'll update the answer.
Paul R