【问题标题】:ASIHTTPREQUEST framework compile error when method is called / link error调用方法时 ASIHTTPREQUEST 框架编译错误/链接错误
【发布时间】:2012-07-26 15:37:38
【问题描述】:

我正在尝试使用 ASIHTTPREQUEST 库编译一个项目。

我按照指示链接到所有必要的库,我没有收到不是编译错误的错误...我被允许尝试编译项目。

只有当我尝试在我的 .m 中使用此代码时才会出现问题

NSURL *colorURL = [NSURL URLWithString:@"http://www.colourlovers.com/api/colors?format=json"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:colorURL]; [请求 setDelegate:self]; [请求启动异步];

来自本教程: http://ios-blog.co.uk/tutorials/parsing-json-on-ios-with-asihttprequest-and-sbjson/

ld /Users/johndoe/Library/Developer/Xcode/DerivedData/round5-bdubuaqrmfeeujdoabfnpkzsctpa/Build/Products/Debug-iphonesimulator/round5.app/round5 normal i386 cd /Users/johndoe/Documents/apps/iphone/corelocationtest/round5 setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/ usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5。 1.sdk -L/Users/johndoe/Library/Developer/Xcode/DerivedData/round5-bdubuaqrmfeeujdoabfnpkzsctpa/Build/Products/Debug-iphonesimulator -F/Users/johndoe/Library/Developer/Xcode/DerivedData/round5-bdubuaqrmfeeujdoabfnpkzsctpa/Build/ Products/Debug-iphonesimulator -filelist /Users/johndoe/Library/Developer/Xcode/DerivedData/round5-bdubuaqrmfeeujdoabfnpkzsctpa/Build/Intermediates/round5.build/Debug-iphonesimulator/round5.build/Objects-normal/i386/round5.LinkFileList - mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -lz -framework CFNetwork -framework SystemConfiguration -framework MobileCoreServices -framework CoreLocation -framework UIKit -framework Foundation -framework CoreGrap hics -o /Users/johndoe/Library/Developer/Xcode/DerivedData/round5-bdubuaqrmfeeujdoabfnpkzsctpa/Build/Products/Debug-iphonesimulator/round5.app/round5 架构 i386 的未定义符号: “_OBJC_CLASS_$_ASIHTTPRequest”,引用自: round5ViewController.o 中的 objc-class-ref ld:未找到体系结构 i386 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

我不明白这个错误是什么意思:

架构 i386 的未定义符号: “_OBJC_CLASS_$_ASIHTTPRequest”,引用自: round5ViewController.o 中的 objc-class-ref ld:未找到体系结构 i386 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

真的迷路了……请帮忙!!

PS:我查看了堆栈溢出的其他一些线程,但它们没有引用相同的错误。

【问题讨论】:

    标签: objective-c ios asihttprequest xcode4.3


    【解决方案1】:

    没关系!!!

    重复: Error with iOS 5.1 when i use ASIHTTPRequest and SBJSON

    “我会查看 Target 中的 Build Phases 部分。在“Compile Sources”下,确保您看到 ASIHTTPRequest 和 SBJson 的 .m 文件。有时当您将外部类拖到项目中时,即使您选中复选框将文件复制到您的项目中,它们不会进入这些编译源。当您将文件拖到 Xcode 中时,有一个复选框可以将文件添加到目标。如果没有选中,该文件不会进入编译源。删除文件并重新添加它们,确保检查此文件(或者如果您愿意,可以手动添加 .m 文件)。

    通过 jmstone

    【讨论】:

      猜你喜欢
      • 2012-08-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-17
      • 1970-01-01
      • 2012-07-11
      • 1970-01-01
      • 2011-09-14
      • 2014-12-13
      相关资源
      最近更新 更多