1) Add the files

Copy the files you need to your project folder, and add them to your Xcode project. An overview of the ASIHTTPRequest source files appears here.

If you aren't sure which files you need, it's best to copy all the following files:

  • 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 projects must also include:

  • ASIAuthenticationDialog.h
  • ASIAuthenticationDialog.m
  • Reachability.h (in the External/Reachability folder)
  • Reachability.m (in the External/Reachability folder)

2) Link with CFNetwork, SystemConfiguration, MobileCoreServices, CoreGraphics and zlib

Open the settings for your target by clicking on the blue bar at the very top of the Xcode sidebar:

Open the Build Phases tab, expand the box labeled Link Binary With Libraries then click the plus button.

Choose CFNetwork.framework from the list, and click Add:

Repeat the last two steps to add the following: SystemConfiguration.frameworkMobileCoreServices.framework,CoreGraphics.framework and libz.dylib.

Using ASIHTTPRequest in a Mac OS X project

To use ASIHTTPRequest in a Mac project, you'll need to link against:

  • SystemConfiguration.framework + zlib (as above)
  • CoreServices.framework
    CFNetwork is part of the CoreServices framework on Mac OS X. Unless you are writing a console-based application, your application is probably already setup to link with CoreServices, but if not, simply add CoreServices.framework in the same way as described above.

Building the tests

Most users can skip this part!

The tests that come with ASIHTTPRequest primarily exist for my benefit, so I can check I haven’t broken something when I make changes. You only need to run the tests if you are making changes to ASIHTTPRequest, or want to confirm that something is working as expected.

ASIHTTPRequest uses Gabriel Handford’s wonderful GHUnit framework for running tests.

As of v1.8-50, GHUnit is no longer included as a git submodule. Instead, build scripts automatically download a pre-compiled framework if one does not already exist locally. If you would prefer to build GHUnit yourself, simply grab a copy from GitHub, and drop your built framework in External/GHUnit.

Some of the tests require additional information to run:

    • To run the S3 tests, you need to specify your S3 access details in the top of ASIS3RequestTests.m
    • To run the proxy tests, you need to specify details of your proxy server, and a PAC file if you want to run the PAC tests. Note that the proxy tests require a proxy server, while all the other tests require that you don't have a proxy server.

Using ASIHTTPRequest in an iOS project的更多相关文章

  1. 解决 React-Native mac 运行报错 error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by ope

    React-Native 开发的项目,Android 方面没有任何问题,IOS 就是无法跑起来,报错信息如下: mac 10.14.4 xcode 10.2.1 error Failed to bui ...

  2. iOS - Project 项目

    1.项目流程 1.1 分析项目的架构 iOS 常见的几种架构 标签式 Tab Menu 列表式 List Menu 抽屉式 Drawer 瀑布式 Waterfall 跳板式 Springborad 陈 ...

  3. Step by Step iOS Project In Action - 视图控制器

    1. 什么是视图控制器(View Controller) 简单来说,视图控制器用来管理你所有的视图. 他们是你的视图和模型的粘合剂. 如果你做过MVC的Web项目,我想你应该不会对它感到陌生. 2. ...

  4. ASIHTTPRequest 类库在iOS 7.0中,会有一些报错警告,需要稍作修改

    1. if ([inputStream streamStatus] == NSStreamEventErrorOccurred) { 修改成: if ([inputStream streamStatu ...

  5. iOS通过ASIHTTPRequest提交JSON数据

    先验知识——什么是ASIHTTPRequest? 使用iOS SDK中的HTTP网络请求API,相当的复杂,调用很繁琐,ASIHTTPRequest就是一个对CFNetwork API进行了封装,并且 ...

  6. iOS - ASIHTTPRequest 网络请求

    前言 使用 iOS SDK 中的 HTTP 网络请求 API,相当的复杂,调用很繁琐,ASIHTTPRequest 就是一个对 CFNetwork API 进行了封装,并且使用起来非常简单的一套 AP ...

  7. ASIHTTPREQUEST 文档

    http://blog.csdn.net/ysysbaobei/article/details/17026577 Please note that I am no longer working on ...

  8. 初识IOS,Label控件的应用。

    初识IOS,Label控件的应用. // // ViewController.m // Gua.test // // Created by 郭美男 on 16/5/31. // Copyright © ...

  9. Send Push Notifications to iOS Devices using Xcode 8 and Swift 3, APNs Auth Key

    Send Push Notifications to iOS Devices using Xcode 8 and Swift 3 OCT 6, 2016 Push notifications are ...

随机推荐

  1. 设置EntityFramework中decimal类型数据精度问题(EF默认将只会保留到2为精度)

    原文:设置EntityFramework中decimal类型数据精度 EF中默认的decimal数据精度为两位数,当我们数据库设置的精度大于2时,EF将只会保留到2为精度. e.g. .19990将会 ...

  2. php + ajax实现 帖子点赞功能

    知识: 一.首先页面需要加载jquery框架 二.ajax常用参数解释: ①.type:传输数据方式,get或者post ②.url:处理数据的PHP脚本 ③.data:传输的数据索引及值,值用js获 ...

  3. qemu中device和driver的区别 使用9p文件系统

    qemu配置中经常会出现-driver/-device的选项,可以理解成-driver是后端设备,即一个实际的物理的磁盘:device是把这块磁盘插入到虚机中的pci控制器中. 这样的话,虚机也能看到 ...

  4. ES6 Destructuring Assignment All In One

    ES6 Destructuring Assignment All In One ES6 & Destructuring Assignment Axios, vue https://develo ...

  5. NBUT校赛 J Alex’s Foolish Function(分块+延迟标记)

    Problem J: Alex’s Foolish Function Time Limit: 8 Sec  Memory Limit: 128 MB Submit: 18  Solved: 2 Des ...

  6. 基站选址(base.c/cpp/pas)

    基站选址(base.c/cpp/pas) 题目描述  有N个村庄坐落在一条直线上,第i(i>1)个村庄距离第1个村庄的距离为Di.需要在这些村庄中建立不超过K个通讯基站,在第i个村庄建立基站的费 ...

  7. 转:Android ListView 异步加载图片

    http://www.iteye.com/topic/1118828 http://www.iteye.com/topic/1127914 这样做无疑是非常可取的方法,但是加载图片时仍然会感觉到轻微的 ...

  8. RQNOJ 34 紧急援救

    题目描述 话说2007年8月5日,Mike博士神秘失踪了,最后发现是被外星人绑架了,幸好外星人目前还是在地球上活动,并且知道外星人不了解地球,幸好,Milk博士身上有无线信号发送装置,我们终于确定了他 ...

  9. iOS crash 崩溃问题的追踪方法

    http://www.cnblogs.com/easonoutlook/archive/2012/12/27/2835884.html iOS crash 崩溃问题的追踪方法 在调试程序的时候,总是碰 ...

  10. cocos2d programming guide 翻译 引导页(完结)

    http://bbs.tairan.com/article-25-1.html  Cocos2d官方入门指导 原文地址:http://www.cocos2d-iphone.org/wiki/doku. ...