• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Projects and Targets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Projects and Targets


  • Subject: Re: Projects and Targets
  • From: James Bucanek <email@hidden>
  • Date: Fri, 10 Aug 2007 08:01:24 -0700

Simon Raisin <mailto:email@hidden> wrote (Friday, August 10, 2007 4:00 AM -0400):
Now I want to add my first target, say a Cocoa preference pane target. So I
add a "Cocoa - Loadable Bundle" target, "MyPrefPane" (if I were creating an
entirely new project I'd have access to a wizard that would take care of
everything for a preference pane project).

So, and this is more than likely just my lack of familiarity with these
tools, it appears as though I'd have to create MyPrefPane as its own
external Xcode project, see what gets generated, then attempt to replicate
this back in MyProject.

Again, having to jump through these kind of hoops is what made me question
whether I was really using the tool(s) as they were intended.

Any further enlightenment would be appreciated.

BTW James, I *do* have your book, and I *have* read through Chapter 13, but
the lack of functionality in the "Add Target 'Wizard'" still seems to
require a great deal of manual tweaking.  Is this *really* the way this is
supposed to work?  If that is the case, I am very surprised that an "Import
Existing Target" Wizard isn't provided.

You're correct; the add targets templates are much more limited than the new project templates. And an "Import Target" would be a good candidate for a feature request.


But don't despair, there's more than one way to from here to there and it might not be as bad as it seems. Let's say you want to take project B and add it as a new target to project A.

The first step is create a new target (B) in your existing project A. Then drag all of the source from B into A. Select the "copy" option and add all of the new source items to target B. In one step, Xcode will copy the source into project A's project folder and re-add them all to the new target. If you have common files, you'll likely not want to copy those then later add the existing common files to target B.

For the build settings, go to your existing target in project B. Choose a single build configuration (like "Release") and set it to show only Customized Settings. Select All. Copy. Go to the same build configuration in your new target in project A. Select the same or corresponding build configuration, set it show only Customized Settings. Select All. Delete. Paste. You've now transferred all of the build settings for that configuration from project B to target B in project A. Repeat with the other build configurations and you're done.

Well, almost done. I'm sure you'll spend the next hour or so cleaning up loose ends, like untangling the multiple Info.plist and prefix headers files you now have. If you have sets of targets that all use the same set of build configurations, you might want to create xcconfig to consolidate all of those settings in a single location that you can share with multiple targets.


James Bucanek ____________________________________________________________________ Author of Beginning Xcode ISBN: 047175479X <http://www.beginningxcode.com/>

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Projects and Targets (From: "Simon Raisin" <email@hidden>)

  • Prev by Date: Release Build Issues
  • Next by Date: Re: Release Build Issues
  • Previous by thread: Re: Projects and Targets
  • Next by thread: REZ Problems - SysError 2
  • Index(es):
    • Date
    • Thread