iphone:从 Twitter 获取推文时出现问题

发布于 2024-11-07 12:39:56 字数 2339 浏览 0 评论 0原文

在我的 iPhone 应用程序中,我试图从 Twitter 获取推文。

我从以下链接获得了一个示例编码:

https://github.com/mattgemmell/MGTwitterEngine

但是当我实现了这个例子,我收到以下警告:

Ld build/Debug-iphonesimulator/XAuthTwitterEngineDemo.app/XAuthTwitterEngineDemo normal i386
 cd "/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo"
  setenv MACOSX_DEPLOYMENT_TARGET 10.6
 setenv PATH      "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk "-L/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/build/Debug-iphonesimulator" "-L/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/Libraries & Headers/OAuthConsumer" "-L/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo" "-F/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/build/Debug-iphonesimulator" -filelist "/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/build/XAuthTwitterEngineDemo.build/Debug-iphonesimulator/XAuthTwitterEngineDemo.build/Objects-normal/i386/XAuthTwitterEngineDemo.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -lOAuth -lsqlite3 -lxml2 -o "/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/build/Debug-iphonesimulator/XAuthTwitterEngineDemo.app/XAuthTwitterEngineDemo"

ld: in /Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/libxml2.dylib, file too small
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

可以做什么?

In my iphone app, I am trying to fetch tweets from twitter.

And I got one example coding from following link :

https://github.com/mattgemmell/MGTwitterEngine

But when i implemented this example I got following warning:

Ld build/Debug-iphonesimulator/XAuthTwitterEngineDemo.app/XAuthTwitterEngineDemo normal i386
 cd "/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo"
  setenv MACOSX_DEPLOYMENT_TARGET 10.6
 setenv PATH      "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk "-L/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/build/Debug-iphonesimulator" "-L/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/Libraries & Headers/OAuthConsumer" "-L/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo" "-F/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/build/Debug-iphonesimulator" -filelist "/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/build/XAuthTwitterEngineDemo.build/Debug-iphonesimulator/XAuthTwitterEngineDemo.build/Objects-normal/i386/XAuthTwitterEngineDemo.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -lOAuth -lsqlite3 -lxml2 -o "/Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/build/Debug-iphonesimulator/XAuthTwitterEngineDemo.app/XAuthTwitterEngineDemo"

ld: in /Volumes/MacShare/ANKIT BACKUP/aral-XAuthTwitterEngine-8713a93/aral-XAuthTwitterEngine-8713a93/XAuthTwitterEngineDemo/libxml2.dylib, file too small
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

What can be done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

成熟的代价 2024-11-14 12:39:56

您可以从此 url 获取推文返回 xml,您可以从中解析推文。

You can fetch tweets from this url and it returns xml from which you can parse tweets.

浮生面具三千个 2024-11-14 12:39:56

您遇到的问题在于 MGTwitterEngine 项目适用于 Cocoa,因此它链接的框架和库仅适用于 MacOS 二进制文件。具体来说它们是:libxml2和AppKit。

为了将其移植到 iOS,您应该创建一个新的 iOS 项目,导入所有源代码,并链接到 UIKit(这应该已经可以了)和 libxml2 的 iOS 版本(当您执行“添加现有的框架”)....

The problem you are having lays with the fact that the MGTwitterEngine project is meant for Cocoa, so it links frameworks and libraries that are MacOS-only binaries. Specifically they are: libxml2 and AppKit.

In order to port this to iOS, you should create a new iOS project, import all the source code, and link to UIKit (this should already be ok) and to the iOS version of libxml2 (which you find when you do "add existing framework")....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文