3

I want to create two targets for my application iphone and ipad version. My question is : Do I need to copy all the files from one target to another , because i found out that there are two AppDelegate files in my project, and what about resource and library files? This is the first time when i am trying to setup a multitarget project.

Bhavin
  • 27,155
  • 11
  • 55
  • 94
taffarel
  • 4,015
  • 4
  • 33
  • 61

1 Answers1

2

No, there is no need to copy source files. You can click on each file and tell Xcode which target they belong to (The Target Membership section of the File Inspector tab in the right pane).

Any files that are meant to be different (like the delegate classes you mention) obviously won't be added to both targets.

trojanfoe
  • 120,358
  • 21
  • 212
  • 242
  • so you mean i can safely remove AppDelegate from my second target and check all files to belong to all targets right? – taffarel Jan 07 '13 at 14:32
  • @taffarel If the app is *Universal* then that can be achieved with a single app delegate. See: http://stackoverflow.com/questions/3844296/universal-iphone-ipad-appdelegate – trojanfoe Jan 07 '13 at 14:33
  • @trojanfoe app is not a Universal, I just want to use same code for two targets and at the and make a two different .app files – taffarel Jan 07 '13 at 14:36
  • @taffarel OK, so you might be better off keeping them separate, although you can still probably get away with a single app delegate with conditional code for each target. – trojanfoe Jan 07 '13 at 14:40