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. Linux下性能测量和调试诊断工具Systemtap

    一.简介 SystemTap是一个诊断Linux系统性能或功能问题的开源软件.它使得对运行时的Linux系统进行诊断调式变得更容易.更简单.有了它,开发者或调试人员不再需要重编译.安装新内核.重启动等 ...

  2. [洛谷P3978][TJOI2015]概率论

    题目大意:对于一棵随机生成的$n$个结点的有根二叉树,所有不同构的形态等概率出现(这里同构当且仅当两棵二叉树根相同,并且相同节点的左儿子和右儿子都相同),求叶子节点个数的期望是多少? 题解:令$f_n ...

  3. [洛谷P2613]【模板】有理数取余

    题目大意:给你$a,b(a,b\leqslant10^{10001})$,求出$\dfrac a b\equiv1\pmod{19260817}$,无解输出 Angry! 题解:在读入的时候取模,若$ ...

  4. Hash表模板

    namespace Hash { ; ; struct adj { ll nxt,v,num,val; }e[N]; ll head[H],ecnt=; void init() { ecnt=; me ...

  5. BZOJ5300 [Cqoi2018]九连环 【dp + 高精】

    题目链接 BZOJ5300 题解 这题真的是很丧病,,卡高精卡到哭 我们设\(f[i]\)表示卸掉前\(i\)个环需要的步数 那么 \[f[i] = 2*f[i - 2] + f[i - 1] + 1 ...

  6. webpack配置优化

    1.使用alias简化路径 alias: { 'vue$': 'vue/dist/vue.esm.js', '@': resolve('src') } 2.overlay界面弹出编译错误 devSer ...

  7. DHTMLX 表格组件(dhtmlxGrid )使用介绍

    String sql = select {s.*} from t_student s where s.age22; SQLQuery slqQuery = session.createSQLQuery ...

  8. 用$("...").attr("checked", true)设置勾选无效的原因

    如下图所示,本来想要实现如下图所示的功能,于是我本来是使用$("...").attr("checked", true/false)来实现该功能,但是第一次点击时 ...

  9. eclipse快捷键及各种设置

    1.提示键配置一般默认情况下,Eclipse ,MyEclipse 的代码提示功能是比Microsoft Visual Studio的差很多的,主要是Eclipse ,MyEclipse本身有很多选项 ...

  10. 兼容firstChild和firstElementChild

    1.nextSibling和nextElementSibling 顾名思义,就是找下一个节点 nextSibling在低版本浏览器中可以顺利找到下一个元素节点,而在正常浏览器中找到的包含中间空格. n ...