What is the target relationship?

I feel like the noob is asking this question, but what is target addiction? I see this all the time in Xcode.

+12
source share
2 answers

Dependency is another goal that must be created before the current goal is set. For example, if you have a target program and a target infrastructure, the target point of the application can have the target platform as a dependency to ensure that the structure is built in the first place. That is, the purpose of the application "depends" on the structure.

+17
source

Xcode Dependency [About] is the dependency needed to build the selected goal.

Xcode supports the Implicit [About] and Explicit dependencies.

Explicit dependency is the source code of aka Non-compiled dependency . Xcode builds all explicit dependencies in front of the dependent target. Explicit dependency overrides implicit dependency with the same product_name .

Explicit Dependency is specified in Build Phases -> Target Dependencies .

There are several ways to indicate in Xcode that our goal depends on other target products:

  • If goals are in the same project
    No additional settings
  • If goals are in different projects using cross-project reference [About]
    Specify a search path

Additional notes:

  • Dynamic Framework
    • You must specify General -> Embedded Binaries . If not, on a real device you will get dyld: Library not loaded [About]
    • If you start adding your dependency from General -> Embedded Binaries and select a product with an explicit dependency, Xcode will automatically add it to Build Phases -> Target Dependencies
  • Static binary
    • You can only fill in Build Phases -> Target Dependencies

vocabular

More here , here

0
source

Source: https://habr.com/ru/post/886452/


All Articles