处理AFNetworking的SystemConfiguration与MobileCoreServices告警

在使用AFNetworking框架时会看到有如下告警:

#warning SystemConfiguration framework not found in project, or not included in precompiled header. Network reachability functionality will not be available.

#warning MobileCoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available.

AFNetworking可选的依赖SystemConfiguration框架来进行网络可达性监测,依赖MobileCoreServices对上传文件进行MIME类型检测。如果没有包含这两个框架或者没有在预编译头文件中包括就会有上述告警.
解决方法为:

  1. 在项目中增加SystemConfiguration和MobileCoreServices框架(对应Mac OS X,则为CoreServices).
  2. 在项目的预编译头文件Prefix.pch中增加对应的头文件
    #import <SystemConfiguration/SystemConfiguration.h>
    #import <MobileCoreServices/MobileCoreServices.h>
    //or #import <CoreServices/CoreServices> for Mac OS X

参考:
Warning about missing SystemConfiguration and CoreServices on iOS
AFNetworking FAQ

转载: http://www.winddisk.com/2013/03/24/%e5%a4%84%e7%90%86afnetworking%e7%9a%84systemconfiguration

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值