Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.13 KB

2015_10_08.md

File metadata and controls

47 lines (36 loc) · 1.13 KB

Objectives

  • Store and retreive data to/from Parse
  • Understand the fundamental difference between local storage and remote storage

Parse

Pre-app setup

  1. Create a Parse application on https://parse.com
  2. Get Application ID and Client Key (Settings -> Keys)

Installation
pod 'Parse', '~> 1.8'

Application setup

// AppDelegate.h
#import <Parse/Parse.h>

...

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [Parse setApplicationId:@"9348j2p934fj2p94f8j23"
                  clientKey:@"2398fj23-98fj2-398fj23f"];
    return YES;
}

Add object

PFObject *object = [PFObject objectWithClassName:@"TestObject"];
object[@"name"] = @"Mike";
[object saveInBackground];

Find objects

PFQuery *query = [PFQuery queryWithClassName:@"TestObject"];
[query findObjectsInBackgroundWithBlock:^(NSArray * objects, NSError * error) {
    NSLog(@"%@", objects);
}];

TOGETHER WE BUILD!!!!!!!

Full parse documentation