Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode reference a framework instead of link binary with libraries

When developing cocoa touch framework, how can i use code from third party framework by referencing it other then including it in the "link binary with libraries" option?

I dont want to link to binary in order to prevent symbol conflicts between hosting project and the framework (project which will use the framework)

Additionally i will need the framework code to use the hosting project reference to the third party framework, how can it be done?

Or should i take different approach for example static framework (i am not familiar with the small differences of the two)

like image 741
Michael A Avatar asked Jul 30 '15 08:07

Michael A


People also ask

Where is link binary with libraries Xcode?

Click on the "+" under "Link Binary With Libraries" to add a new library. Then click on the "Add Other" button. Navigate to the static library file (.

Why is framework red in Xcode?

The red text indicates that the actual files are not at the path that the project has for them. Get info on the framework and look under the General tab.

How do I open framework in Xcode?

Xcode has a tendancy to select the "openFrameworks" scheme instead of the one you actually want (which is your app). Select the dropdown in the top which says "openFrameworks" and set it to your app's name. If you find that you try to run your app and nothing happens, this is almost always the reason.


1 Answers

  1. Select the target you want to modify and reveal its build phases.
  2. Expand the Link Binary With Libraries build phase to view the frameworks currently linked by the target.
  3. If the framework you want to weakly link to is listed in the Link Binary With Libraries build phase, select it, and choose Edit > Delete to remove it. Now you can tell the linker to use weak linking for that framework.
  4. Select the target, open its Info window, and click Build.
  5. To the Other Linker Flags build setting, add the following command-line option specification, where is the name of the framework you want to weakly link to:
-weak_framework <framework_name>
  1. Build your product.

Here is a docs section for that. Docs

More specifically this part.

like image 195
s1ddok Avatar answered Sep 29 '22 20:09

s1ddok