手动配置AFNetworking时, 报错

转自: http://blog.csdn.net/boyqicheng/article/details/51363047#comments


问题:
本来一直使用Pods安装AFNetworking, 但是最近接口对于错误码的处理是,当请求失败(404,500)时,也会返回信息,所以为了达到这种效果,就只有去修改AF的源码,所以准备手动配置AF, 就过就遇到下面的错误:


Undefined symbols for architecture x86_64:
  "_UTTypeCopyPreferredTagWithClass", referenced from:
      _AFContentTypeForPathExtension in AFURLRequestSerialization.o
  "_UTTypeCreatePreferredIdentifierForTag", referenced from:
      _AFContentTypeForPathExtension in AFURLRequestSerialization.o
  "_kUTTagClassFilenameExtension", referenced from:
      _AFContentTypeForPathExtension in AFURLRequestSerialization.o
  "_kUTTagClassMIMEType", referenced from:
      _AFContentTypeForPathExtension in AFURLRequestSerialization.o
ld: symbol(s) not found for architecture x86_64
知道是确少.framework 框架。就不知道是哪个.framework。最后找到是未添加 MobileCoreServices.framework(此框架定义统一类型标识符 (UTIs)使用的底层类型)


解决:Build Phase ->Link Binary With Libraries()下添加 MobileCoreServices.framework。添加成功后运行程序成功。吐舌头
如果在新建的工程中直接导入AFNetworking 和UIKit+AFNetworking 文件夹是不会报错,即使最低支持版本7.0,Bitcode值为NO,不添加 MobileCoreServices.framework 都不会报错。这和工程的配置有关。
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值