一、下载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"