Parse 教程 框架倒入

Cloud Code now allows sending of general HTTP requests and other updates.  Learn More Close
Open

Parse

Push guide

Quick Start Guide

This step-by-step guide will get you up and running using the Parse SDK in your mobile app.

1

Choose your platform

iOS

Android

JavaScript

Windows 8

New Project
Existing Project
2

Select your Parse app

Nanjing
3

Download & install the SDK

  1. Download the SDK:

     SDK files for existing iOS projects (.zip)
  2. Make sure you are using the latest version of Xcode (v4.5+) and targeting iOS 4.3 or higher.
  3. Unzip the file you downloaded and drag the Parse folder into your Xcode project folder target.
  4. Make sure the "Copy items to destination's group folder" checkbox is checked. (Show Me)
  5. It should now look something like this.
  6. Click on the Targets → Your app name → and then the 'Build Phases' tab and then expand 'Link Binary With Libraries' as shown.
  7. Click the plus button in the bottom left of the 'Link Binary With Libraries' section. (Show Me)
  8. Add the following libraries:
    • AudioToolbox.framework (Show Me)
    • Accounts.framework
    • AdSupport.framework
    • CFNetwork.framework
    • CoreGraphics.framework
    • CoreLocation.framework
    • libsqlite3.dylib
    • libz.1.1.3.dylib
    • MobileCoreServices.framework
    • QuartzCore.framework
    • Security.framework
    • Social.framework
    • StoreKit.framework
    • SystemConfiguration.framework
  9. Open up your AppDelegate.m file and add the following import to the top of the file:

    #import <Parse/Parse.h>

    Then paste the following inside the application:didFinishLaunchingWithOptions: function:

    [Parse setApplicationId:@"B7q3ZUcn1mOISdkSCx01wR2JbZsgL3BgSveErGNL"
                  clientKey:@"wMiv55odJnH0BUmr2HbjaXsatAxKeoKneCr2wBbp"];
  10. Compile and run.
  11. If you're targeting iOS versions less than 6.0, you'll need to make AdSupport.framework, Social.framework, and Accounts.framework optionally-linked. (Show Me)
  12. If you're targeting iOS versions less than 5.0, you'll need to add the "-fobjc-arc" flag to the "Other Linker Flags" entry in your target build settings. (Show Me)
4

Test the SDK

  • First make sure to include our SDK libraries from your .h file: (Show Me) 

    #import <Parse/Parse.h>
  • Then copy and paste this code into your app, for example in the viewDidLoad method (or inside another method that gets called when you run your app): (Show Me)


    PFObject *testObject = [PFObject objectWithClassName : @"TestObject" ];
    [testObject setObject : @"bar" forKey : @"foo" ];
    [testObject save ];

Run your app. A new object of class TestObject will be sent to the Parse Cloud and saved. When you're ready, click the button below to test if your data was sent.

Test
5

Learn the SDK

Dive into our docs

Start learning about everything you can do with Parse!

Use the dashboard

Start controlling your apps, managing your settings, and more.

你可能感兴趣的:(Parse 教程 框架倒入)