我正在尝试使用ASIHTTPREQUEST库编译项目。
我按照指示操作并链接到所有必需的库,我没有得到任何不是编译错误的错误......我可以尝试编译项目。
当我尝试在我的.m
中使用此代码时,问题就出现了NSURL * colorURL = [NSURL URLWithString:@“http://www.colourlovers.com/api/colors?format=json”]; ASIHTTPRequest * request = [ASIHTTPRequest requestWithURL:colorURL]; [request setDelegate:self]; [请求startAsynchronous];本教程中的
: 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:我在堆栈溢出时查看了其他一些线程,但它们没有引用相同的错误。
答案 0 :(得分:1)
重复: Error with iOS 5.1 when i use ASIHTTPRequest and SBJSON
“我会看一下Target中的Build Phases部分。在”Compile Sources“下,确保你看到ASIHTTPRequest和SBJson的.m文件。有时你把外部类拖到一个项目中,即使你选中复选框将文件复制到项目中,它们不会进入这些编译源。当你将文件拖入Xcode时,有一个复选框将文件添加到目标。如果没有选中,该文件不会进入编译源。删除文件并重新添加,确保检查此文件(或者如果您愿意,可以手动添加.m文件)。“
by jmstone