如何在 iPhone 项目中添加第三方框架? [英] How do I add a third party Framework to iPhone project?

查看:35
本文介绍了如何在 iPhone 项目中添加第三方框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 iPhone 应用程序中使用 PLDatabase 框架.我已将框架添加到我的 Xcode 项目中.但是,当我运行我的应用程序时,它崩溃并显示以下错误:

I am trying to use the PLDatabase framework in my iPhone app. I've added the framework to my Xcode project. However, when I run my app, it crashes with the following error:

dyld: Library not loaded: @loader_path/../Frameworks/PlausibleDatabase.framework/Versions/A/PlausibleDatabase
  Referenced from: /Users/todd/Library/Application Support/iPhone Simulator/User/Applications/BB3C66B2-A5BB-4329-B163-AB0072411AF1/Congress.app/Congress
  Reason: image not found

我不确定框架需要驻留在磁盘上的确切位置才能找到.

I'm not sure exactly where the Framework needs to reside on disk to be found.

谢谢

推荐答案

iPhone 不支持嵌入式框架的动态链接.虽然您可能能够使模拟器工作,但它在设备上不起作用.如果要使用代码,必须为框架构建静态库(libpldatabase.a),然后将它们链接到应用程序.

iPhone does not support dynamic linking of embedded frameworks. While you might be able to finagle the simulator to work, it will not work on the device. If you want to use the code you must build the static library for the framework (libpldatabase.a), and then link them to the app.

Xcode GUI 没有为静态链接提供一个很好的界面,您需要在构建首选项中添加适当的标志 (-lpldatabase -L/whatever/dir/it/is/in).

The Xcode GUI does not provide a nice interface for static linking, you will need to add appropriate flags in your build prefs (-lpldatabase -L/whatever/dir/it/is/in).

这篇关于如何在 iPhone 项目中添加第三方框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆