如何在 iPhone 项目中添加第三方框架?

编程入门 行业动态 更新时间:2024-10-05 17:24:43
本文介绍了如何在 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 项目中添加第三方框架?

本文发布于:2023-11-26 09:38:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1633595.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:第三方   框架   项目   如何在   iPhone

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!