郝萌主倾心贡献,尊重作者的劳动成果,请勿转载。

假设文章对您有所帮助。欢迎给作者捐赠。支持郝萌主,捐赠数额任意,重在心意^_^

我要捐赠: 点击捐赠

Cocos2d-X源代码下载:点我传送

This is a guide to help developers get up to speed with AFNetworking. It is geared primarily towards anyone who is new to Mac or iOS development, or has not worked extensively with 3rd-party libraries
before.

These step-by-step instructions are written for Xcode 5, using the iOS 7 SDK. If you are using a previous version of Xcode, you may want to update before starting.

Step 1: Download CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking
in your projects.

CocoaPods is distributed as a ruby gem, and is installed by running the following commands in Terminal.app:

$ sudo gem install cocoapods
$ pod setup

Depending on your Ruby installation, you may not have to run assudo to install the cocoapods gem.

Step 2: Create a Podfile

Project dependencies to be managed by CocoaPods are specified in a file calledPodfile. Create this file in the same directory as your Xcode project (.xcodeproj) file:

$ touch Podfile
$ open -a Xcode Podfile

You just created the pod file and opened it using Xcode! Ready to add some content to the empty pod file?

Copy and paste the following lines into the TextEdit window:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.5'

You shouldn’t use TextEdit to edit the pod file because TextEdit likes to replace standard quotes with more graphically appealing quotes. This can cause CocoaPods to get confused and display errors,
so it’s best to just use Xcode or another programming text editor.

Step 3: Install Dependencies

Now you can install the dependencies in your project:

$ pod install

From now on, be sure to always open the generated Xcode workspace (.xcworkspace) instead of the project file when building your project:

$ open <YourProjectName>.xcworkspace

Step 4: Dive In!

At this point, everything's in place for you to start using AFNetworking. Just#import the headers for the classes you need and get to it!

郝萌主倾心贡献,尊重作者的劳动成果,请勿转载。

假设文章对您有所帮助。欢迎给作者捐赠,支持郝萌主,捐赠数额任意。重在心意^_^

我要捐赠: 点击捐赠

Cocos2d-X源代码下载:点我传送

版权声明:本文博客原创文章,博客,未经同意,不得转载。

开始AFNetworking的更多相关文章

  1. 【原】AFNetworking源码阅读(六)

    [原]AFNetworking源码阅读(六) 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 这一篇的想讲的,一个就是分析一下AFSecurityPolicy文件,看看AF ...

  2. 【原】AFNetworking源码阅读(五)

    [原]AFNetworking源码阅读(五) 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 上一篇中提及到了Multipart Request的构建方法- [AFHTTP ...

  3. 【原】AFNetworking源码阅读(四)

    [原]AFNetworking源码阅读(四) 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 上一篇还遗留了很多问题,包括AFURLSessionManagerTaskDe ...

  4. 【原】AFNetworking源码阅读(三)

    [原]AFNetworking源码阅读(三) 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 上一篇的话,主要是讲了如何通过构建一个request来生成一个data tas ...

  5. 【原】AFNetworking源码阅读(二)

    [原]AFNetworking源码阅读(二) 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 上一篇中我们在iOS Example代码中提到了AFHTTPSessionMa ...

  6. 【原】AFNetworking源码阅读(一)

    [原]AFNetworking源码阅读(一) 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 AFNetworking版本:3.0.4 由于我平常并没有经常使用AFNetw ...

  7. AFNetworking 3.0 源码解读 总结(干货)(下)

    承接上一篇AFNetworking 3.0 源码解读 总结(干货)(上) 21.网络服务类型NSURLRequestNetworkServiceType 示例代码: typedef NS_ENUM(N ...

  8. AFNetworking 3.0 源码解读 总结(干货)(上)

    养成记笔记的习惯,对于一个软件工程师来说,我觉得很重要.记得在知乎上看到过一个问题,说是人类最大的缺点是什么?我个人觉得记忆算是一个缺点.它就像时间一样,会自己消散. 前言 终于写完了 AFNetwo ...

  9. AFNetworking 3.0 源码解读(十一)之 UIButton/UIProgressView/UIWebView + AFNetworking

    AFNetworking的源码解读马上就结束了,这一篇应该算是倒数第二篇,下一篇会是对AFNetworking中的技术点进行总结. 前言 上一篇我们总结了 UIActivityIndicatorVie ...

  10. AFNetworking 3.0 源码解读(十)之 UIActivityIndicatorView/UIRefreshControl/UIImageView + AFNetworking

    我们应该看到过很多类似这样的例子:某个控件拥有加载网络图片的能力.但这究竟是怎么做到的呢?看完这篇文章就明白了. 前言 这篇我们会介绍 AFNetworking 中的3个UIKit中的分类.UIAct ...

随机推荐

  1. ASP.NET MVC 5 学习教程:修改视图和布局页

    原文 ASP.NET MVC 5 学习教程:修改视图和布局页 起飞网 ASP.NET MVC 5 学习教程目录: 添加控制器 添加视图 修改视图和布局页 控制器传递数据给视图 添加模型 创建连接字符串 ...

  2. Net::OpenSSH 模块使用

    use Net::OpenSSH; my $host = "$ip"; my $user = 'root'; my $passphrase = 'uxxxxxD'; my $key ...

  3. 使用storyboard实现页面跳转,简单的数据传递

    由于最近才接触到IOS,苹果已经建议storyboard来搭建所有界面了,于是我 也追随时尚,直接开始使用storyboard.(不料在涉及到页面跳转的时候,遇到的问题是:点击后没有任何反应)众所周知 ...

  4. python下载文件(图片)源码,包含爬网内容(爬url),可保存cookie

    #coding=utf-8 ''' Created on 2013-7-17 @author: zinan.zhang ''' import re import time import httplib ...

  5. Sql 参数的使用

    代码片段: a)声明实例 1.声明SQLCommand实例. SqlCommand cmd = new SqlCommand(); 2.声明SqlDataAdapter实例. SqlDataAdapt ...

  6. Java进阶03 IO基础

    链接地址:http://www.cnblogs.com/vamei/archive/2013/04/11/3000905.html 作者:Vamei 出处:http://www.cnblogs.com ...

  7. Step by step guide to set up master and slave machines(转)

    Note: There is no need to install Jenkins on the slave machine. On your master machine go to Manage ...

  8. 基于visual Studio2013解决算法导论之010快排中应用插入排序

     题目 快排中引用插入排序 解决代码及点评 #include <stdio.h> #include <stdlib.h> #include <malloc.h> ...

  9. ajax异步请求实例

    1. 问题分析 用户管理显示页面:usermanagement.tpl(也可以说是MVC中的V,即视图) 用户管理数据发送页面:usermanagement.php(也可以说是MVC中的M,即模型) ...

  10. android电话接通状态下,关机铃声无法从外放输出

    AudioMTKPolicyManager.cpp的startOutput方法中.将在newDevic获取到的后面加入: if(stream==AudioSystem::BOOT)newDevice| ...