Using ASIHTTPRequest in an iOS project
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.framework, MobileCoreServices.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的更多相关文章
- 解决 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 ...
- iOS - Project 项目
1.项目流程 1.1 分析项目的架构 iOS 常见的几种架构 标签式 Tab Menu 列表式 List Menu 抽屉式 Drawer 瀑布式 Waterfall 跳板式 Springborad 陈 ...
- Step by Step iOS Project In Action - 视图控制器
1. 什么是视图控制器(View Controller) 简单来说,视图控制器用来管理你所有的视图. 他们是你的视图和模型的粘合剂. 如果你做过MVC的Web项目,我想你应该不会对它感到陌生. 2. ...
- ASIHTTPRequest 类库在iOS 7.0中,会有一些报错警告,需要稍作修改
1. if ([inputStream streamStatus] == NSStreamEventErrorOccurred) { 修改成: if ([inputStream streamStatu ...
- iOS通过ASIHTTPRequest提交JSON数据
先验知识——什么是ASIHTTPRequest? 使用iOS SDK中的HTTP网络请求API,相当的复杂,调用很繁琐,ASIHTTPRequest就是一个对CFNetwork API进行了封装,并且 ...
- iOS - ASIHTTPRequest 网络请求
前言 使用 iOS SDK 中的 HTTP 网络请求 API,相当的复杂,调用很繁琐,ASIHTTPRequest 就是一个对 CFNetwork API 进行了封装,并且使用起来非常简单的一套 AP ...
- ASIHTTPREQUEST 文档
http://blog.csdn.net/ysysbaobei/article/details/17026577 Please note that I am no longer working on ...
- 初识IOS,Label控件的应用。
初识IOS,Label控件的应用. // // ViewController.m // Gua.test // // Created by 郭美男 on 16/5/31. // Copyright © ...
- 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 ...
随机推荐
- try...catch 语句
一般情况下,我们很少用到 try...catch 语句,但是有时候为了测试代码中的错误,也有可能会用到.小白我也在工作中用到过.那么好的程序设计,什么时候会用到呢? try...catch 一般用来捕 ...
- Redis、Mongodb、memcache区别在哪里?
最近在看一本书<php mvc开发实战>看到Redis实战部分,详细介绍了几种缓存的区别和对比,帮助解决这方面的疑惑 Redis适合哪些业务场景?
- 重写Android相机适配不同的设备,对于相机旋转角度问题解决方案
Android开发中经常需要重写相机,由此会导致一些旋转的情况(不同的设备摄像头角度是不一样的),此处按照解决思路给出解决方案: 情形一:只需要旋转摄像头方向以及最终的照片,注意两者需要保持一致 1. ...
- Arcgis桌面开发,Python引用GDAL库的方法
我用的是arcgis10.2,python版本是arcgis自动安装的Pythin2.7 1.下载gdal-111-1700-core.msi和对应的GDAL-1.11.1.win32-py2.7.m ...
- 内存检测工具valgrind
valgrind --tool=memcheck --leak-check=full --error-limit=no --trace-children=yes ./server valgrind ...
- linux下对/sys/class/gpio中的gpio的控制 (转)
在嵌入式设备中对GPIO的操作是最基本的操作.一般的做法是写一个单独驱动程序,网上大多数的例子都是这样的.其实linux下面有一个通用的GPIO操作接口,那就是我要介绍的 “/sys/clas ...
- ES6特性以及代码demo
块级作用域let if(true){ let fruit = ‘apple’; } consoloe.log(fruit);//会报错,因为let只在if{ }的作用域有效,也就是块级作用域 恒量co ...
- 转:Java SoftReference 使用构建对象缓存
本文介绍对象的强.软.弱和虚引用的概念.应用及其在UML中的表示. 1.对象的强.软.弱和虚引用 在JDK 1.2以前的版本中,若一个对象不被任何变量引用,那么程序就无法再使用这个对象.也就是说, ...
- linux mint 自动挂载windows的D盘和E盘
终端敲udisksctl mount -p block_devices/sda后双击tab键补全分区,如下: 如我的E盘是sda6,执行 udisksctl mount -p block ...
- linux -特殊符号
在shell中常用的特殊符号罗列如下: # ; ;; . , / \\ 'string'| ! $ ${} $? $$ $* \"string\"* ** ...