xcode - 在 Xcode 3.2 中使用第三方框架时出现问题

标签 xcode oauth frameworks

我正在尝试使用第三方库 (MPOAuthConnection) 设置自己的项目来连接到 oauth REST API。

到目前为止我已经完成的步骤:

  1. 已下载 MPOAuthConnection 源代码。
  2. 构建了源代码并在“产品”选项卡中生成了 MPOAuth.framework。
  3. 打开我现有的项目并将 MPOAuth.framework 拖到我项目的“链接框架”中。
  4. 构建我的项目,但在运行时失败并出现以下错误

[Session started at 2009-11-03 16:41:37 -0600.]
Warning - No location found for "OAuthClientController.m:68"
GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul 3 01:19:56 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys002
Loading program into debugger…
sharedlibrary apply-load-rules all
warning: Unable to read symbols for
"@executable_path/../Frameworks/MPOAuth.framework/Versions/A/MPOAuth" (file not found).
warning: Unable to read symbols from "MPOAuth" (not yet mapped into memory).
Program loaded.
run
[Switching to process 32686]
Running…
dyld: Library not loaded:
@executable_path/../Frameworks/MPOAuth.framework/Versions/A/MPOAuth
Referenced from:
/Users/markpowell/Documents/Programming/Cocoa/Celery/build/Debug/Celery.app/Contents/MacOS/Celery
Reason: image not found
No memory available to program now: unsafe to call malloc
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.)

显然,它在运行时找不到任何框架信息,但在编译时可以吗?我对 OS X 平台有点陌生,所以在使用这些工具方面仍然有些困难。任何帮助将不胜感激。

编辑:我确实添加了一个新的构建阶段 -> 新复制文件构建阶段,将框架 (MPOAuth.framework) 拖到对话框中并将其设置为转到框架。但仍然遇到同样的错误。

最佳答案

您似乎尚未将 MPOAuth 框架复制到您的应用程序包中:

“@executable_path/../Frameworks/MPOAuth.framework/Versions/A/MPOAuth”(未找到文件)。

@exectuable_path 是“.../MyApp.app/Contents/MacOS”内应用程序二进制文件的路径

您应该为您的目标创建一个新的构建阶段“复制文件阶段”,并将目标指定为“框架”。将 Xcode 项目中的 MPOAuth 框架拖到该路径中,它将被复制到正确的位置。

编辑 2009 年 11 月 3 日:17:59 EST:我强烈建议阅读 Xcode 文档,因为当我学习如何有效使用此工具时,它为我节省了大量时间。当 Xcode 处于事件状态时,从“帮助”菜单中选择“Xcode 帮助”。

关于xcode - 在 Xcode 3.2 中使用第三方框架时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1670672/

相关文章:

iphone - 有没有办法以编程方式完全清除 iPhone 数据?

ios - 无法在 tabbarcontroller 之前显示登录屏幕

ios - 如何在 xcode 5 中查找对方法的引用

c# - DocuSign JWT 认证 : Unexpected PEM type

ios - 使用 CMake 将 .frameworks 复制到 iOS 应用程序包

ios - iPhone应用程序是否可以使用iPhone 5或更高版本?

facebook - 部署到 heroku 而无需使用护照回调重定向到本地主机

asp.net-web-api - 为什么不调用 GrantRefreshToken 方法 - Oauth2 ASP.NET Web API

c# - asp.net 可以在没有.net 框架的情况下运行吗

php - 电子商务框架,目前正在关注Magento