在Xcode 3.2中使用第三方框架时遇到问题 [英] Trouble Using Third Party Framework In Xcode 3.2

查看:82
本文介绍了在Xcode 3.2中使用第三方框架时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用第三方库(MPOAuthConnection)来建立自己的项目,以连接到oauth REST API.

I am attempting to set up my own project using a third party library (MPOAuthConnection) for connecting to an oauth REST API.

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

Steps I've gone through thus far:

  1. MPOAuthConnection的下载源.
  2. 内置源,并在产品"标签中生成了MPOAuth.framework.
  3. 打开我的现有项目并将MPOAuth.framework拖到我项目的链接框架"中.
  4. 构建我的项目,它在运行时失败,并显示以下错误

[会议于2009-11-03开始 16:41:37 -0600.]
警告-否 找到的位置 "OAuthClientController.m:68"
GNU gdb 6.3.50-20050815(Apple版本 gdb-1344)(UTC星期五7月3日01:19:56 2009)
版权所有2004免费软件 Foundation,Inc.
GDB是免费的 GNU General涵盖的软件 公共许可证,您
欢迎更改和/或分发 在某些情况下的副本 条件.
键入显示复制"到 请参阅条件.
有 GDB绝对不提供任何保证.类型 有关详细信息,请显示保修".
GDB被配置为 "x86_64-apple-darwin" .tty /dev/ttys002
将程序加载到 调试器...
sharedlibrary apply-load-rules all
警告: 无法读取以下符号
"@executable_path/../Frameworks/MPOAuth.framework/Versions/A/MPOAuth" (未找到文件).
警告:无法 从"MPOAuth"读取符号(不是 尚未映射到内存).
程序 已加载.
运行
[切换到 进程32686]
正在运行…
dyld: 库未加载:
@executable_path/../Frameworks/MPOAuth.framework/Versions/A/MPOAuth
引用自:
/用户/markpowell/文档/编程/Cocoa/Celery/build/Debug/Celery.app/Contents/MacOS/Celery
原因:找不到图像
没有内存 现在可用于编程:不安全 调用malloc
数据格式化程序 暂时不可用,将重试 在继续"之后. (不安全打电话 dlopen.)

[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平台有些陌生,因此仍在使用工具方面有些挣扎.任何帮助将不胜感激.

So apparently, it can't find any of the framework information at runtime, but can at compile time? I'm a bit new to the OS X platform, so still struggling a bit with the tools. Any help would be greatly appreciated.

编辑:我确实添加了一个新的构建阶段->新建副本文件构建阶段,将框架(MPOAuth.framework)拖到对话框中并将其设置为框架.但是仍然出现相同的错误.

I did add a new Build Phase -> New Copy Files Build phase, dragged the Framework (MPOAuth.framework) to the dialog and set it to go to Frameworks. But still got the same error.

推荐答案

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

It looks like you haven't copied the MPOAuth framework into your application bundle:

"@ executable_path/../Frameworks/MPOAuth.framework/Versions/A/MPOAuth"(找不到文件).

"@executable_path/../Frameworks/MPOAuth.framework/Versions/A/MPOAuth" (file not found).

@exectuable_path是".../MyApp.app/Contents/MacOS"中您的应用程序二进制文件的路径

The @exectuable_path is the path to your application binary inside of ".../MyApp.app/Contents/MacOS"

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

You should create a new build phase for your target, "Copy Files Phase" that specifies the destination as "Frameworks". Drag the MPOAuth framework in your Xcode project into that path and it will be copied into the correct location.

EDIT 2009年11月3日:美国东部时间17:59 :我强烈建议您阅读Xcode文档,因为当我学会了如何有效使用此工具时,它节省了大量时间. Xcode处于活动状态时,从帮助"菜单中选择"Xcode帮助".

EDIT Nov 3rd, 2009: 17:59 EST: I would highly suggest reading the Xcode documentation as it saved me a ton of time when I learned how to use this tool effectively. Select "Xcode Help" from the "Help" menu while Xcode is active.

这篇关于在Xcode 3.2中使用第三方框架时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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