开源框架:AFNetworking

来源:互联网 发布:csgo安卓软件 编辑:程序博客网 时间:2024/06/11 16:56

源代码地址:

AFNetworking的托管地址: 

https://github.com/AFNetworking/AFNetworking


安装

安装的首选方式使用CocodPods

问题1:安装完毕后,可能遇到问题,如下图:


原因是: MobileCoreServices.framework 框架没有引用到主工程中.  引入即可.

问题2: #import <AFNetworking> 以后编辑时产生警告,如下图:


解决办法是,在 Project-Prefix.pch 文件中添加如下全局引入:

#ifdef __OBJC__  #import <Cocoa/Cocoa.h>  #import <SystemConfiguration/SystemConfiguration.h>  #import <MobileCoreServices/MobileCoreServices.h>#endif
参考Stackoverflow的一问


使用:



通过 AFNetworkReachabilityManager 监控网络可达性






原创粉丝点击