You can add dependencies between your targets so that they build in the correct order.
If your scheme has the Find Implicit Dependencies checkbox enabled, any framework or library listed in a target's Link Binaries With Libraries build phase will implicitly produce a dependency on the target which produces that framework or library, if such a target is present in your project or workspace. Frameworks and libraries linked via the Other Linker Flags
build setting do not establish implicit dependencies, so you may need to create explicit target dependencies instead for such targets.
In the project editor, choose the target from the Project/Targets pop-up menu, then click Build Phases.
Next to Target Dependencies, click the disclosure triangle icon to reveal the dependencies.
At the bottom of the table, click the Add button (+).
In the project editor, choose the target from the Project/Targets pop-up menu, then click Build Phases.
Next to Target Dependencies, click the disclosure triangle icon to reveal the dependencies.
Select the target to remove, then click the Delete button (–) at the bottom of the table.
If you disable parallel builds, the targets are built in the order that you specify.
In the project editor, choose the target from the Project/Targets pop-up menu, then click Build Phases.
Next to Target Dependencies, click the disclosure triangle icon to reveal the dependencies.
To change the order, drag the targets in the table.