How do I weak link frameworks on Xcode 4?

浪尽此生 提交于 2019-11-26 22:49:13

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

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

ronguotech

This doesn't work now. Please follow the link below: https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html

Select the target you want to modify and reveal its build phases.

Expand the Link Binary With Libraries build phase to view the frameworks currently linked by the target.

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.

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

Build your product.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!