当我使用ASIHTTPRequest和SBJSON时,iOS 5.1错误 [英] Error with iOS 5.1 when i use ASIHTTPRequest and SBJSON

查看:144
本文介绍了当我使用ASIHTTPRequest和SBJSON时,iOS 5.1错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到此错误:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_ASIHTTPRequest", referenced from:
      objc-class-ref in FirstViewController.o
  "_OBJC_CLASS_$_SBJsonParser", referenced from:
      objc-class-ref in FirstViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

注意我已经添加了框架核心图形,系统配置,移动核心服务,libz.dylib,libz.1.2.5.dylib,CF Network,UI Kit和Foundation. 我搜索了所有论坛并花费了将近4天,但找不到原因.

Note i have added the frameworks core graphics,system configuration,mobile core services,libz.dylib,libz.1.2.5.dylib,CF Network,UI Kit and Foundation. I have searched all the forums and spend almost 4 days but just don't find the cause.

当我评论我的ASIHTTPRequest和SBJSON代码行时,它工作正常. 我添加了ASIHTTPRequest和SBJSON的所有类,并检查了三次. 有人可以暗示我在做什么错吗?

When i comment my ASIHTTPRequest and SBJSON code lines,it works fine. I have added all the classes for ASIHTTPRequest and SBJSON and checked thrice. Could anyone suggest what am i doing wrong?

推荐答案

我将看一下目标"中的构建阶段"部分.在编译源"下,确保您看到ASIHTTPRequest和SBJson的.m文件.有时,当您将外部类拖到项目中时,即使选中将文件复制到项目中的复选框,它们也不会进入这些编译源.当您将文件拖到Xcode中时,会出现一个复选框,用于将文件添加到目标中.如果未选中此选项,则该文件不会进入编译源".删除文件并重新添加它们,确保选中此文件(或者,如果需要,您可以手动添加.m文件).

I would take a look at the Build Phases section in your Target. Under "Compile Sources", make sure you see the .m files for ASIHTTPRequest and for SBJson. Sometimes when you drag external classes into a project, even if you check the box to copy the files into your project, they don't make it into these compile sources. When you drag a file into Xcode, there is a check box to add the file to the target. If this isn't checked, the file won't make it into the Compile Sources. Delete the files and re-add them, ensuring this file is checked (or you can add the .m files manually if you'd like).

这篇关于当我使用ASIHTTPRequest和SBJSON时,iOS 5.1错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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