开始使用AFNetworking
2015-06-03 09:39
330 查看
郝萌主倾心贡献,尊重作者的劳动成果,请勿转载。 如果文章对您有所帮助,欢迎给作者捐赠,支持郝萌主,捐赠数额随意,重在心意^_^
我要捐赠: 点击捐赠 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.
CocoaPods is distributed as a ruby gem, and is installed by running the following commands in Terminal.app:
Copy and paste the following lines into the TextEdit window:
郝萌主倾心贡献,尊重作者的劳动成果,请勿转载。 如果文章对您有所帮助,欢迎给作者捐赠,支持郝萌主,捐赠数额随意,重在心意^_^
我要捐赠: 点击捐赠 Cocos2d-X源码下载:点我传送
我要捐赠: 点击捐赠 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 setupDepending on your Ruby installation, you may not have to run as
sudoto 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 PodfileYou 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 installFrom 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#importthe headers for the classes you need and get to it!
郝萌主倾心贡献,尊重作者的劳动成果,请勿转载。 如果文章对您有所帮助,欢迎给作者捐赠,支持郝萌主,捐赠数额随意,重在心意^_^
我要捐赠: 点击捐赠 Cocos2d-X源码下载:点我传送
相关文章推荐
- 配置mysql自动备份
- 学习SSH时的练习demo,实现分页和登录等简单功能
- 用栈(链式)实现十进制到其他进制的转换:
- php json 中文乱码
- MSMQ
- webservice 的wsdl文件生成客户端java类
- T-SQL 控制流语句
- Python实现建立SSH连接的方法
- [Erlang]VM启动参数研究
- 记一次云计算测试实验-openstack-icehouse-安装dashboard
- 电子信息工程专业的发展方向(读此明志)
- java虚拟机的垃圾回收机制
- SQL Server 2012 Enterprise Edition安装过程详解(包含每一步设置的含义)
- IPv6 DS-Lite服务器搭建
- python 操作 MySql 数据库
- 分布式进阶(十三)Docker Container间实现数据共享
- 全选和全部取消 复选框
- Ibatis中sqlmap参数map中还需要套list的情况如何写?
- 融云 Android sdk 2.1+ 稳定版 UI 和 模块功能自定义
- Android学习 - ant批量打包