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

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

我要捐赠: 点击捐赠

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. Python 2.7 学习笔记 字典(map)的使用

    python中的字典,就是通常说的map,即 key/value集合的数据结构. 本文来介绍下在python下如何使用字典. 对于map这种数据结构能干什么,我们就不说了,这是一个常见的数据结构,我们 ...

  2. AzureDev 社区活动获奖者公布

    今天,我们高兴地宣布 AzureDev社区活动的获奖者,并向这 5 个非盈利技术教育组织发放 10 万美元奖金.在 2013 年的Build大会上宣布的 AzureDev 活动专注于通过代码改变世界, ...

  3. Codeforces Round #FF (Div. 2):C. DZY Loves Sequences

    C. DZY Loves Sequences time limit per test 1 second memory limit per test 256 megabytes input standa ...

  4. Java 开源博客——B3log Solo 0.6.7 正式版公布了!

    Java 开源博客 -- B3log Solo 0.6.7 正式版公布了!欢迎大家下载. 另外,欢迎观摩 B3log 团队的新项目:Wide,也很欢迎大家參与进来 :-) 特性 基于标签的文章分类 P ...

  5. c++,operator=

    operator=为什么值得注意? 从语法上讲,下面的程序可以编译通过,我在另一篇笔记示例里面也这样用了. class A1 { public: int operator=(int a)//参数是in ...

  6. eclipse No Default Proposals 无提示

    链接地址:http://blog.csdn.net/rogerjava/article/details/5689785 今天特抑郁,早上开机后发现eclipse的代码提示功能不好使了,Alt+/ 这么 ...

  7. python-Day3-set 集合-counter计数器-默认字典(defaultdict) -可命名元组(namedtuple)-有序字典(orderedDict)-双向队列(deque)--Queue单项队列--深浅拷贝---函数参数

    上节内容回顾:C语言为什么比起他语言块,因为C 会把代码变异成机器码Pyhton 的 .pyc文件是什么python 把.py文件编译成的.pyc文件是Python的字节码, 字符串本质是 字符数组, ...

  8. 我的Python成长之路---第二天---Python基础(7)---2016年1月9日(晴)

    再说字符串 一.字符串的编码 字符串的编码是个很令人头疼的问题,由于计算机是美国人发明的,他们很理所当然的认为计算机只要能处理127个字母和一些符号就够用了,所以规定了一个字符占用8个比特(bit)也 ...

  9. perl 读取cookie

    use LWP::UserAgent; use HTTP::Date qw(time2iso str2time time2iso time2isoz); use Net::Ping; use Sock ...

  10. 新书:《Liferay Portal 6.1最佳实践门户网站建设》

    新书:<Liferay Portal 6.1最佳实践门户网站建设>   <Liferay Portal 6.1门户站点建设最佳实践>是国内第一本全面介绍Liferay Port ...