iOS: AFNetworking手动配置(iOS7.1, AF2.2.4)

时间:2021-08-10 07:14:13

一、下载AFNetworking.

二、将AFNetworking-master下的AFNetworking目录拖入到项目中

三、为项目添加Linking to a Library or Framework

CoreLocation.framework
SystemConfiguration.framework
Security.framework
MobileCoreServices.framework

四、修改项目.pch文件

 #ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
//添加AFNetworking包预编译头
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#import "AFNetworking.h"
#endif

五、在相应的文件中加入引入

    #import "AFNetworking.h"