Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I weak link frameworks on Xcode 4?

I need to weak link some framework with my target.
But I can't find how to do it...

If I try to run my project on 3.2 iPad simulator i get the following error:

dyld: Library not loaded: /System/Library/Frameworks/iAd.framework/iAd Reason : Image not found 

Thanks !

like image 523
Quentin Hayot Avatar asked Jun 25 '11 21:06

Quentin Hayot


People also ask

How do I link framework in Xcode?

To include a framework in your Xcode project, choose Project > Add to Project and select the framework directory. Alternatively, you can control-click your project group and choose Add Files > Existing Frameworks from the contextual menu.

How do you make a link a weak framework?

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. Select the target, open its Info window, and click Build. Build your product.

Where is framework in Xcode?

In Xcode, select File ▸ New ▸ Project…. Then choose iOS ▸ Framework & Library ▸ Framework.


1 Answers

Go to your project -> Targets -> Build Phases -> Link Binary with Libraries.

Then change the library you want to weak-link from "Required" to "Optional".

like image 127
uvesten Avatar answered Oct 13 '22 17:10

uvesten