Using ASIHTTPRequest in an IOS project

Source: Internet
Author: User

1) Add The files

Copy The files you need to your project folder, and add them to your Xcode project. A 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 of 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 APPL Ication is probably already setup to link with coreservices, and if not, simply add coreservices.framework in the same 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 m Ake changes. You have need to run the tests if you be making changes to asihttprequest, or want to confirm that something is working a S 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/GH Unit.

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 the your proxy server, and a PAC file if you want to run the PAC tests. Note that the proxy tests require a proxy server and the while all of the other tests require so you don't have a proxy server.

Using ASIHTTPRequest in an IOS project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.