ASIHTTPRequest 使用

来源:互联网 发布:苹果mac怎么切换系统 编辑:程序博客网 时间:2024/05/16 15:49

首先介绍两篇写得不错的博客:

http://blog.csdn.net/kmyhy/article/details/6524916

http://www.dreamingwish.com/dream-category/api-in-chinese/asihttprequest-doc

要使用ASIHTTPRequest此开源库,首先要下载源码  http://github.com/pokeb/asi-http-request/tree 

ASIHTTPRequest 是一个开源项目,要使用他,直接拷贝项目源文件到你的项目中,包括下列文件(即Classes下所有文件和External/Reachability下所有文件):

  • ASIHTTPRequestConfig.h
  • ASIHTTPRequestDelegate.h
  • ASIProgressDelegate.h
  • ASICacheDelegate.h
  • ASIHTTPRequest.h
  • ASIHTTPRequest.m
  • ASIDataCompressor.h
  • ASIDataCompressor.m
  • ASIDataDecompressor.h
  • ASIDataDecompressor.m
  • ASIFormDataRequest.h
  • ASIInputStream.h
  • ASIInputStream.m
  • ASIFormDataRequest.m
  • ASINetworkQueue.h
  • ASINetworkQueue.m
  • ASIDownloadCache.h
  • ASIDownloadCache.m

对于 iPhone,还要拷贝下列文件:

  • ASIAuthenticationDialog.h
  • ASIAuthenticationDialog.m
  • Reachability.h (External/Reachability 目录 )
  • Reachability.m (External/Reachability 目录 )

 

2、添加依赖库

ASIHTTPRequest 依赖于以下5个框架或库:

CFNetwork, SystemConfiguration, MobileCoreServices, CoreGraphics 和 libz1.2.3。

依次将上述库和框架添加到 target 的 Linked Libraries 中。


原创粉丝点击