zoukankan      html  css  js  c++  java
  • 开始AFNetworking

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

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

    我要捐赠: 点击捐赠

    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源代码下载:点我传送


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

  • 相关阅读:
    Git安装配置
    Openstack 错误日志查看方法
    keystone v3.0与2.0的区别
    Python远程调试Openstack
    openstack遇到的错误
    特别翔实的adaboost分类算法讲解 转的
    h5 html5 模拟时钟 页面
    js 面向对象 jquery 全局变量 封装
    HTML5 h5 微信 浮层 提示 点击右上角,从浏览器打开 pop.png
    jquery中ajax使用error调试错误的方法,实例分析了Ajax的使用方法与error函数调试错误的技巧
  • 原文地址:https://www.cnblogs.com/hrhguanli/p/4717408.html
Copyright © 2011-2022 走看看