Information Technology Reference
In-Depth Information
Figure 12.8 illustrates how each level overrides the next. Levels with higher priority override those lower down
the list.
The second key point is that Xcode only stores the highest level setting needed to create an unambiguous
resolution.
If you scroll through the table, you'll see that many settings are left to their system defaults. There's no entry for
either the project or the target. Because they're left empty, the resolved value is the same as the default.
This may seem like a trivial point, but in fact it's crucial. When you edit a target or project setting, you're not
only modifying its value, you're alsoadding a new entry to the settings table.
Why does this matter? Consider the following sequence of actions:
1. You edit a project setting.
2. The setting has the highest priority, so it applies to all targets. You can change it repeatedly, and it's always
applied.
3. Later on, you decide to edit that setting for one target.
4. The new target setting is applied as you'd expect.
5. You change the project setting again.
6. Because a target setting exists now, the new project setting isn't applied to the target . The target setting
continues to override it.
As soon as you change a setting at the target level, you lock out all future project-level changes to that setting.
This is almost intuitive—but not quite. If you work exclusively in the Combined View, it can be difficult to un-
derstand what's happening, because sometimes changes you make are applied as you'd expect, and sometimes
they aren't.
The Combined View doesn't illustrate the difference in priority between target and project settings. It also
doesn't make it clear that if no target setting has been defined, a project setting can—confusingly—appear to
override a target setting.
FIGURE 12.8
Build settings are arranged in levels. The diagram shows how levels with higher priority override lower levels.
Search WWH ::




Custom Search