Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode Edit Project Settings vs Edit Active Target

Tags:

What is the difference between these 2 options under the Project menu drop-down? Normally I just adjusted things in the Project Settings (which adjusts the info.plist, right?).

Today I needed to change the name of my project. Initially i changed the Product_Name from the Edit Project Settings -> Build window. But that didnt change the name.

Then I tried changing the the Product_Name from the Edit Active Target -> Build window, and that seemed to do the trick.

So again, what's the difference? XCode never fails to confuse me just when im beginning to think i have it all figured out! Argh!!!

like image 659
Edward An Avatar asked Aug 06 '09 16:08

Edward An


People also ask

What is the difference between project and target in Xcode?

An project is a repository for all the files, resources, and information required to build one or more software products. A target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace.

How do I change project target in Xcode?

Changing the target name is just as simple. Click on the project name at the top left, then select a target name on the right pane followed by pressing "Enter". Type in the new name. @Alan, in Xcode 6, this was changed to a square icon, with a bolded line on the left side.

Where is target settings in Xcode?

Choose the project in the Project Navigator on the left. Select the Configurations target from the Targets section and click the Build Settings tab at the top. The Build Settings tab shows the build settings for the Configurations target. It's possible to expand this list with build settings that you define.


2 Answers

Project settings apply to all targets in your project. Target settings apply only to that specific target. You likely have only a single target which can make the two sets of settings confusing and appear redundant.

If a setting is set (appears in bold) for both the project and a target, the target setting overrides the project setting.

Target settings which aren't set (do not appear in bold) are inherited from the project settings. Project settings which aren't set (do not appear in bold) are inherited from Xcode's default settings.

If a setting (either project or target) is set (appears in bold) and you instead want to inherit that setting, select the setting and press Delete.

I suggest you prefer using the target settings. Use the project settings for larger, multi-target projects where you really do want to share settings across targets.

like image 123
Jon-Eric Avatar answered Oct 07 '22 16:10

Jon-Eric


It's worth adding that properties set at project level are not automatically inherited from the different configurations / targets of your project: in order to inherit properties that are set at project level you need to set the value $(inherited) in the fields where you actually want to inherit such properties.

like image 31
step Avatar answered Oct 07 '22 16:10

step