Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 41ad32916d79df36f4f979f5c59b8014941c0f5e 0 parents
@jamesyu jamesyu authored
Showing with 9,014 additions and 0 deletions.
  1. +10 −0 .gitignore
  2. +56 −0 Parse.framework/Headers/PFACL.h
  3. +106 −0 Parse.framework/Headers/PFConstants.h
  4. +112 −0 Parse.framework/Headers/PFFile.h
  5. +67 −0 Parse.framework/Headers/PFGeoPoint.h
  6. +242 −0 Parse.framework/Headers/PFObject.h
  7. +42 −0 Parse.framework/Headers/PFPointer.h
  8. +175 −0 Parse.framework/Headers/PFPush.h
  9. +323 −0 Parse.framework/Headers/PFQuery.h
  10. +127 −0 Parse.framework/Headers/PFQueryTableViewController.h
  11. +310 −0 Parse.framework/Headers/PFUser.h
  12. +63 −0 Parse.framework/Headers/PF_EGORefreshTableHeaderView.h
  13. +21 −0 Parse.framework/Headers/PF_FBConnect.h
  14. +167 −0 Parse.framework/Headers/PF_FBDialog.h
  15. +48 −0 Parse.framework/Headers/PF_FBLoginDialog.h
  16. +116 −0 Parse.framework/Headers/PF_FBRequest.h
  17. +112 −0 Parse.framework/Headers/PF_Facebook.h
  18. +342 −0 Parse.framework/Headers/PF_MBProgressHUD.h
  19. +61 −0 Parse.framework/Headers/Parse.h
  20. BIN  Parse.framework/Parse
  21. +20 −0 Parse.framework/Resources/Info.plist
  22. BIN  Parse.framework/Resources/blueArrow.png
  23. BIN  Parse.framework/Resources/blueArrow@2x.png
  24. +56 −0 Parse.framework/Versions/0.4.12/Headers/PFACL.h
  25. +106 −0 Parse.framework/Versions/0.4.12/Headers/PFConstants.h
  26. +112 −0 Parse.framework/Versions/0.4.12/Headers/PFFile.h
  27. +67 −0 Parse.framework/Versions/0.4.12/Headers/PFGeoPoint.h
  28. +242 −0 Parse.framework/Versions/0.4.12/Headers/PFObject.h
  29. +42 −0 Parse.framework/Versions/0.4.12/Headers/PFPointer.h
  30. +175 −0 Parse.framework/Versions/0.4.12/Headers/PFPush.h
  31. +323 −0 Parse.framework/Versions/0.4.12/Headers/PFQuery.h
  32. +127 −0 Parse.framework/Versions/0.4.12/Headers/PFQueryTableViewController.h
  33. +310 −0 Parse.framework/Versions/0.4.12/Headers/PFUser.h
  34. +63 −0 Parse.framework/Versions/0.4.12/Headers/PF_EGORefreshTableHeaderView.h
  35. +21 −0 Parse.framework/Versions/0.4.12/Headers/PF_FBConnect.h
  36. +167 −0 Parse.framework/Versions/0.4.12/Headers/PF_FBDialog.h
  37. +48 −0 Parse.framework/Versions/0.4.12/Headers/PF_FBLoginDialog.h
  38. +116 −0 Parse.framework/Versions/0.4.12/Headers/PF_FBRequest.h
  39. +112 −0 Parse.framework/Versions/0.4.12/Headers/PF_Facebook.h
  40. +342 −0 Parse.framework/Versions/0.4.12/Headers/PF_MBProgressHUD.h
  41. +61 −0 Parse.framework/Versions/0.4.12/Headers/Parse.h
  42. BIN  Parse.framework/Versions/0.4.12/Parse
  43. +20 −0 Parse.framework/Versions/0.4.12/Resources/Info.plist
  44. BIN  Parse.framework/Versions/0.4.12/Resources/blueArrow.png
  45. BIN  Parse.framework/Versions/0.4.12/Resources/blueArrow@2x.png
  46. +56 −0 Parse.framework/Versions/Current/Headers/PFACL.h
  47. +106 −0 Parse.framework/Versions/Current/Headers/PFConstants.h
  48. +112 −0 Parse.framework/Versions/Current/Headers/PFFile.h
  49. +67 −0 Parse.framework/Versions/Current/Headers/PFGeoPoint.h
  50. +242 −0 Parse.framework/Versions/Current/Headers/PFObject.h
  51. +42 −0 Parse.framework/Versions/Current/Headers/PFPointer.h
  52. +175 −0 Parse.framework/Versions/Current/Headers/PFPush.h
  53. +323 −0 Parse.framework/Versions/Current/Headers/PFQuery.h
  54. +127 −0 Parse.framework/Versions/Current/Headers/PFQueryTableViewController.h
  55. +310 −0 Parse.framework/Versions/Current/Headers/PFUser.h
  56. +63 −0 Parse.framework/Versions/Current/Headers/PF_EGORefreshTableHeaderView.h
  57. +21 −0 Parse.framework/Versions/Current/Headers/PF_FBConnect.h
  58. +167 −0 Parse.framework/Versions/Current/Headers/PF_FBDialog.h
  59. +48 −0 Parse.framework/Versions/Current/Headers/PF_FBLoginDialog.h
  60. +116 −0 Parse.framework/Versions/Current/Headers/PF_FBRequest.h
  61. +112 −0 Parse.framework/Versions/Current/Headers/PF_Facebook.h
  62. +342 −0 Parse.framework/Versions/Current/Headers/PF_MBProgressHUD.h
  63. +61 −0 Parse.framework/Versions/Current/Headers/Parse.h
  64. BIN  Parse.framework/Versions/Current/Parse
  65. +20 −0 Parse.framework/Versions/Current/Resources/Info.plist
  66. BIN  Parse.framework/Versions/Current/Resources/blueArrow.png
  67. BIN  Parse.framework/Versions/Current/Resources/blueArrow@2x.png
  68. +343 −0 ParseStarterProject.xcodeproj/project.pbxproj
  69. +8 −0 ParseStarterProject/Entitlements.plist
  70. +13 −0 ParseStarterProject/MyTableController.h
  71. +217 −0 ParseStarterProject/MyTableController.m
  72. +38 −0 ParseStarterProject/ParseStarterProject-Info.plist
  73. +14 −0 ParseStarterProject/ParseStarterProject-Prefix.pch
  74. +17 −0 ParseStarterProject/ParseStarterProjectAppDelegate.h
  75. +125 −0 ParseStarterProject/ParseStarterProjectAppDelegate.m
  76. +9 −0 ParseStarterProject/ParseStarterProjectViewController.h
  77. +43 −0 ParseStarterProject/ParseStarterProjectViewController.m
  78. +2 −0  ParseStarterProject/en.lproj/InfoPlist.strings
  79. +444 −0 ParseStarterProject/en.lproj/MainWindow.xib
  80. +190 −0 ParseStarterProject/en.lproj/ParseStarterProjectViewController.xib
  81. +11 −0 ParseStarterProject/main.m
10 .gitignore
@@ -0,0 +1,10 @@
+*~
+.DS_Store
+*.mode1v3
+*.mode2v3
+*.pbxuser
+*.perspectivev3
+*.xcworkspace
+*.swp
+xcuserdata
+
56 Parse.framework/Headers/PFACL.h
@@ -0,0 +1,56 @@
+// PFACL.h
+// Copyright 2011 Parse, Inc. All rights reserved.
+
+#import <Foundation/Foundation.h>
+
+@class PFUser;
+
+/*!
+ The PFACL is an access control list that can apply to a PFObject. The PFACL determines which users have
+ read and write permissions to the object.
+ */
+@interface PFACL : NSObject <NSCopying> {
+ NSMutableDictionary *permissionsById;
+}
+
+/*!
+ Creates an ACL with no permissions granted.
+ */
++ (PFACL *)ACL;
+
+/*!
+ Creates an ACL where only the provided user has access.
+ */
++ (PFACL *)ACLWithUser:(PFUser *)user;
+
+/*!
+ Set whether the public is allowed to read this object.
+ */
+- (void)setPublicReadAccess:(BOOL)allowed;
+
+/*!
+ Set whether the public is allowed to write this object.
+ */
+- (void)setPublicWriteAccess:(BOOL)allowed;
+
+/*!
+ Set whether the given user id is allowed to read this object.
+ */
+- (void)setReadAccess:(BOOL)allowed forUserId:(NSString *)userId;
+
+/*!
+ Set whether the given user id is allowed to write this object.
+ */
+- (void)setWriteAccess:(BOOL)allowed forUserId:(NSString *)userId;
+
+/*!
+ Set whether the given user is allowed to read this object.
+ */
+- (void)setReadAccess:(BOOL)allowed forUser:(PFUser *)user;
+
+/*!
+ Set whether the given user is allowed to write this object.
+ */
+- (void)setWriteAccess:(BOOL)allowed forUser:(PFUser *)user;
+
+@end
106 Parse.framework/Headers/PFConstants.h
@@ -0,0 +1,106 @@
+// PFConstants.h
+// Copyright 2011 Parse, Inc. All rights reserved.
+
+#import <Foundation/Foundation.h>
+
+// Version
+#define PARSE_VERSION @"0.4.12"
+
+extern NSInteger const PARSE_API_VERSION;
+
+// Server
+extern NSString *const kPFParseServer;
+
+// Cache policies
+typedef enum {
+ kPFCachePolicyIgnoreCache = 0,
+ kPFCachePolicyCacheOnly,
+ kPFCachePolicyNetworkOnly,
+ kPFCachePolicyCacheElseNetwork,
+ kPFCachePolicyNetworkElseCache,
+ kPFCachePolicyCacheThenNetwork
+} PFCachePolicy;
+
+// Errors
+
+/*! @abstract 1: Internal server error. No information available. */
+extern NSInteger const kPFErrorInternalServer;
+/*! @abstract 100: The connection to the Parse servers failed. */
+extern NSInteger const kPFErrorConnectionFailed;
+/*! @abstract 101: Object doesn't exist, or has an incorrect password. */
+extern NSInteger const kPFErrorObjectNotFound;
+/*! @abstract 102: You tried to find values matching a datatype that doesn't support exact database matching, like an array or a dictionary. */
+extern NSInteger const kPFErrorInvalidQuery;
+/*! @abstract 103: Missing or invalid classname. Classnames are case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the only valid characters. */
+extern NSInteger const kPFErrorInvalidClassName;
+/*! @abstract 104: Missing object id. */
+extern NSInteger const kPFErrorMissingObjectId;
+/*! @abstract 105: Invalid key name. Keys are case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the only valid characters. */
+extern NSInteger const kPFErrorInvalidKeyName;
+/*! @abstract 106: Malformed pointer. Pointers must be arrays of a classname and an object id. */
+extern NSInteger const kPFErrorInvalidPointer;
+/*! @abstract 107: Malformed json object. A json dictionary is expected. */
+extern NSInteger const kPFErrorInvalidJSON;
+/*! @abstract 108: Tried to access a feature only available internally. */
+extern NSInteger const kPFErrorCommandUnavailable;
+/*! @abstract 111: Field set to incorrect type. */
+extern NSInteger const kPFErrorIncorrectType;
+/*! @abstract 112: Invalid channel name. A channel name is either an empty string (the broadcast channel) or contains only a-zA-Z0-9_ characters and starts with a letter. */
+extern NSInteger const kPFErrorInvalidChannelName;
+/*! @abstract 114: Invalid device token. */
+extern NSInteger const kPFErrorInvalidDeviceToken;
+/*! @abstract 115: Push is misconfigured. See details to find out how. */
+extern NSInteger const kPFErrorPushMisconfigured;
+/*! @abstract 116: The object is too large. */
+extern NSInteger const kPFErrorObjectTooLarge;
+/*! @abstract 119: That operation isn't allowed for clients. */
+extern NSInteger const kPFErrorOperationForbidden;
+/*! @abstract 120: The results were not found in the cache. */
+extern NSInteger const kPFErrorCacheMiss;
+/*! @abstract 121: Keys in NSDictionary values may not include '$' or '.'. */
+extern NSInteger const kPFErrorInvalidNestedKey;
+/*! @abstract 122: Invalid file name. A file name contains only a-zA-Z0-9_. characters and is between 1 and 36 characters. */
+extern NSInteger const kPFErrorInvalidFileName;
+/*! @abstract 123: Invalid ACL. An ACL with an invalid format was saved. This should not happen if you use PFACL. */
+extern NSInteger const kPFErrorInvalidACL;
+/*! @abstract 124: The request timed out on the server. Typically this indicates the request is too expensive. */
+extern NSInteger const kPFErrorTimeout;
+/*! @abstract 125: The email address was invalid. */
+extern NSInteger const kPFErrorInvalidEmailAddress;
+
+/*! @abstract 200: Username is missing or empty */
+extern NSInteger const kPFErrorUsernameMissingError;
+/*! @abstract 201: Password is missing or empty */
+extern NSInteger const kPFErrorUserPasswordMissingError;
+/*! @abstract 202: Username has already been taken */
+extern NSInteger const kPFErrorUsernameTakenError;
+/*! @abstract 203: Email has already been taken */
+extern NSInteger const kPFErrorUserEmailTakenError;
+/*! @abstract 204: The email is missing, and must be specified */
+extern NSInteger const kPFErrorUserEmailMissing;
+/*! @abstract 205: A user with the specified email was not found */
+extern NSInteger const kPFErrorUserWithEmailNotFound;
+/*! @abstract 206: The user cannot be altered by a client without the session. */
+extern NSInteger const kPFErrorUserCannotBeAlteredWithoutSession;
+/*! @abstract 207: Users can only be created through sign up */
+extern NSInteger const kPFErrorUserCanOnlyBeCreatedThroughSignUp;
+/*! @abstract 208: An existing Facebook account already linked to another user. */
+extern NSInteger const kPFErrorFacebookAccountAlreadyLinked;
+/*! @abstract 209: User ID mismatch */
+extern NSInteger const kPFErrorUserIdMismatch;
+/*! @abstract 250: Facebook id missing from request */
+extern NSInteger const kPFErrorFacebookIdMissing;
+/*! @abstract 251: Invalid Facebook session */
+extern NSInteger const kPFErrorFacebookInvalidSession;
+
+@class PFObject;
+@class PFUser;
+
+typedef void (^PFBooleanResultBlock)(BOOL succeeded, NSError *error);
+typedef void (^PFIntegerResultBlock)(int number, NSError *error);
+typedef void (^PFArrayResultBlock)(NSArray *objects, NSError *error);
+typedef void (^PFObjectResultBlock)(PFObject *object, NSError *error);
+typedef void (^PFSetResultBlock)(NSSet *channels, NSError *error);
+typedef void (^PFUserResultBlock)(PFUser *user, NSError *error);
+typedef void (^PFDataResultBlock)(NSData *data, NSError *error);
+typedef void (^PFIdResultBlock)(id object, NSError *error);
112 Parse.framework/Headers/PFFile.h
@@ -0,0 +1,112 @@
+//
+// PFFile.h
+// Parse
+//
+// Created by Ilya Sukhar on 10/11/11.
+// Copyright 2011 Ping Labs, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "PFConstants.h"
+
+/*!
+ A file of binary data stored on the Parse servers. This can be a image, video, or anything else
+ that an application needs to reference in a non-relational way.
+ */
+@interface PFFile : NSObject {
+ NSString *name;
+ NSString *url;
+ NSData *data;
+ BOOL isDirty;
+ BOOL isDataAvailable;
+ BOOL isCurrentlyFetching;
+
+ NSMutableArray *callbacks;
+}
+
+/*!
+The name of the file.
+ */
+@property (readonly) NSString *name;
+
+/// The url of the file.
+@property (readonly) NSString *url;
+
+/// Whether the data is available in memory or needs to be downloaded.
+@property (readonly) BOOL isDataAvailable;
+
+///Whether the file has been uploaded for the first time.
+@property (readonly) BOOL isDirty;
+
+/*!
+ Saves the file.
+ @result Returns whether the save succeeded.
+ */
+- (BOOL)save;
+
+/*!
+ Saves the file and sets an error if it occurs.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns whether the save succeeded.
+ */
+- (BOOL)save:(NSError **)error;
+
+/*!
+ Saves the file asynchronously.
+ @result Returns whether the save succeeded.
+ */
+- (void)saveInBackground;
+
+/*!
+ Saves the file asynchronously and calls the given callback.
+ @param target The object to call selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError *)error. error will be nil on success and set if there was an error. [result boolValue] will tell you whether the call succeeded or not.
+ */
+- (void)saveInBackgroundWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Gets the data of the file and loads it in memory if it isn't already.
+ @result The data. Returns nil if there was an error in fetching.
+ */
+- (NSData *)getData;
+
+/*!
+ Gets the data of the file and loads it in memory if it isn't already. Sets an error if it occurs.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result The data. Returns nil if there was an error in fetching.
+ */
+- (NSData *)getData:(NSError **)error;
+
+
+/*!
+ Gets the data of the file asynchronously and loads it in memory if it isn't already.
+ @param target The object to call selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSData *)result error:(NSError *)error. error will be nil on success and set if there was an error.
+ */
+- (void)getDataInBackgroundWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Saves the file asynchronously and executes the given block.
+ @param block The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
+- (void)saveInBackgroundWithBlock:(PFBooleanResultBlock)block;
+
+/*!
+ Gets the data of the file asynchronously and loads it in memory if it isn't already. Executes the given block.
+ @param block The block should have the following argument signature: (NSData *result, NSError *error)
+ */
+- (void)getDataInBackgroundWithBlock:(PFDataResultBlock)block;
+
+/*!
+ Creates a file with given data. A name will be assigned to it by the server.
+ @result A PFFile.
+ */
++ (PFFile *)fileWithData:(NSData *)data;
+
+/*!
+ Creates a file with given data and name.
+ @result A PFFile.
+ */
++ (PFFile *)fileWithName:(NSString *)name data:(NSData *)data;
+
+@end
67 Parse.framework/Headers/PFGeoPoint.h
@@ -0,0 +1,67 @@
+//
+// PFGeoPoint.h
+// Parse
+//
+// Created by Henele Adams on 12/1/11.
+// Copyright (c) 2011 Parse, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+/*!
+ Object which may be used to embed a latitude / longitude point as the value for a key in a PFObject.
+ PFObjects with a PFGeoPoint field may be queried in a geospatial manner using PFQuery's whereKey:nearGeoPoint:.
+
+ This is also used as a point specifier for whereKey:nearGeoPoint: queries.
+
+ Currently, object classes may only have one key associated with a GeoPoint type.
+ */
+
+@interface PFGeoPoint : NSObject<NSCopying> {
+ double latitude;
+ double longitude;
+}
+
+/// Latitude of point in degrees. Valid range (-90.0, 90.0).
+@property (nonatomic) double latitude;
+/// Longitude of point in degrees. Valid range (-180.0, 180.0).
+@property (nonatomic) double longitude;
+
+/*!
+ Create a PFGeoPoint object. Latitude and longitude are set to 0.0.
+ @result Returns a new PFGeoPoint.
+ */
++ (PFGeoPoint *)geoPoint;
+
+/*!
+ Creates a new PFGeoPoint object with the specified latitude and longitude.
+ @param latitude Latitude of point in degrees.
+ @param longitude Longitude of point in degrees.
+ @result New point object with specified latitude and longitude.
+ */
++ (PFGeoPoint *)geoPointWithLatitude:(double)latitude longitude:(double)longitude;
+
+/*!
+ Set latitude.
+ @param newLatitude New latitude of point. Valid range (-90.0, 90.0).
+ */
+- (void)setLatitude:(double)newLatitude;
+
+/*!
+ Get latitude.
+ @result Latitude of point.
+ */
+- (double)latitude;
+
+/*!
+ Set longitude.
+ @param newLongitude New longitude of point. Valid range (-180.0, 180.0).
+ */
+- (void)setLongitude:(double)newLongitude;
+/*!
+ Get longitude.
+ @result Longitude of point.
+ */
+- (double)longitude;
+
+@end
242 Parse.framework/Headers/PFObject.h
@@ -0,0 +1,242 @@
+// PFObject.h
+// Copyright 2011 Parse, Inc. All rights reserved.
+
+#import <Foundation/Foundation.h>
+#import "PFACL.h"
+#import "PFPointer.h"
+#import "PFConstants.h"
+
+/*!
+ A Parse Framework Object that is a local representation of data persisted to the Parse cloud. This is the
+ main class that is used to interact with objects in your app.
+*/
+@interface PFObject : NSObject {
+ BOOL dirty;
+
+ NSString *objectId;
+ NSString *className;
+
+ NSMutableDictionary *pointers;
+ NSMutableDictionary *data;
+
+ NSMutableDictionary *operations;
+
+ // A dictionary that maps id (objects) => PFJSONCache
+ NSMutableDictionary *hashedObjectsCache;
+
+ // A set of dirty keys (strings)
+ NSMutableSet *dirtyKeys;
+
+ NSDate *updatedAt;
+ NSDate *createdAt;
+}
+
+/*!
+ The id of the object.
+ */
+@property (nonatomic, retain) NSString *objectId;
+
+/*!
+ When the object was last updated.
+ */
+@property (readonly) NSDate *updatedAt;
+
+/*!
+ When the object was created.
+ */
+@property (readonly) NSDate *createdAt;
+
+/*!
+ The class name of the object.
+ */
+@property (readonly) NSString *className;
+
+/*!
+ The ACL for this object.
+ */
+@property (nonatomic, retain) PFACL *ACL;
+
+
+/*!
+ Initializes a new PFObject with a class name.
+ @param newClassName A class name can be any alphanumeric string that begins with a letter. It represents an object in your app, like a User or a Document.
+ @result Returns the object that is instantiated with the given class name.
+*/
+- (id)initWithClassName:(NSString *)newClassName;
+
+/*!
+ Creates a new PFObject with a class name.
+ @param className A class name can be any alphanumeric string that begins with a letter. It represents an object in your app, like a User of a Document.
+ @result Returns the object that is instantiated with the given class name.
+ */
++ (PFObject *)objectWithClassName:(NSString *)className;
+
+// Getters
+- (PFPointer *)address;
+
+// Save & Delete
+
+/*!
+ Saves the PFObject.
+ @result Returns whether the save succeeded.
+ */
+- (BOOL)save;
+
+/*!
+ Saves the PFObject and sets an error if it occurs.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns whether the save succeeded.
+ */
+- (BOOL)save:(NSError **)error;
+
+/*!
+ Saves the PFObject asynchronously.
+ */
+- (void)saveInBackground;
+
+/*!
+ Saves the PFObject asynchronously and calls the given callback.
+ @param target The object to call selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError *)error. error will be nil on success and set if there was an error. [result boolValue] will tell you whether the call succeeded or not.
+ */
+- (void)saveInBackgroundWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Refreshes the PFObject with the current data from the server.
+ */
+- (void)refresh;
+
+/*!
+ Refreshes the PFObject with the current data from the server and sets an error if it occurs.
+ @param error Pointer to an NSError that will be set if necessary.
+ */
+- (void)refresh:(NSError **)error;
+
+/*!
+ Refreshes the PFObject asynchronously and calls the given callback.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(PFObject *)refreshedObject error:(NSError *)error. error will be nil on success and set if there was an error. refreshedObject will be the PFObject with the refreshed data.
+ */
+- (void)refreshInBackgroundWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Deletes the PFObject.
+ @result Returns whether the delete succeeded.
+ */
+- (BOOL)delete;
+
+/*!
+ Deletes the PFObject and sets an error if it occurs.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns whether the delete succeeded.
+ */
+- (BOOL)delete:(NSError **)error;
+
+/*!
+ Deletes the PFObject asynchronously.
+ */
+- (void)deleteInBackground;
+
+/*!
+ Deletes the PFObject asynchronously and calls the given callback.
+ @param target The object to call selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError *)error. error will be nil on success and set if there was an error. [result boolValue] will tell you whether the call succeeded or not.
+ */
+- (void)deleteInBackgroundWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Deletes the PFObject asynchronously and executes the given callback block.
+ @param block The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
+- (void)deleteInBackgroundWithBlock:(PFBooleanResultBlock)block;
+
+/*!
+ Saves the PFObject asynchronously and executes the given callback block.
+ @param block The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
+- (void)saveInBackgroundWithBlock:(PFBooleanResultBlock)block;
+
+/*!
+ Refreshes the PFObject asynchronously and executes the given callback block.
+ @param block The block to execute. The block should have the following argument signature: (PFObject *object, NSError *error)
+ */
+- (void)refreshInBackgroundWithBlock:(PFObjectResultBlock)block;
+
+// Get & set fields
+
+/*!
+ Returns the object associated with a given key.
+ @param key The key that the object is associated with.
+ @result The value associated with the given key, or nil if no value is associated with key.
+ */
+- (id)objectForKey:(NSString *)key;
+
+/*!
+ Gets an object in the background - this is useful primarily for fetching child PFObjects (relations).
+ @param key The key for the object
+ @param block The block to execute. The block should have the following signature: (id object, NSError *error)
+ */
+- (void)objectForKey:(NSString *)key inBackgroundWithBlock:(PFIdResultBlock)block;
+
+/*!
+ Sets the object associated with a given key.
+ @param object The object.
+ @param key The key.
+*/
+- (void)setObject:(id)object forKey:(NSString *)key;
+
+/*!
+ Unsets a key on the object.
+ @param key The key.
+*/
+- (void)removeObjectForKey:(NSString *)key;
+
+/*!
+ Increments the given key by 1.
+ @param key The key.
+*/
+- (void)incrementKey:(NSString *)key;
+
+/*!
+ Increments the given key by a number.
+ @param key The key.
+ @param amount The amount to increment.
+ */
+- (void)incrementKey:(NSString *)key byAmount:(NSNumber *)amount;
+
+/*!
+ Saves a collection of objects all at once.
+ @param objects The array of objects to save.
+ @result Returns whether the save succeeded.
+ */
++ (BOOL)saveAll:(NSArray *)objects;
+
+/*!
+ Saves a collection of objects all at once and sets an error if necessary.
+ @param objects The array of objects to save.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns whether the save succeeded.
+ */
++ (BOOL)saveAll:(NSArray *)objects error:(NSError **)error;
+
+/*!
+ Saves a collection of objects all at once asynchronously.
+ @param objects The array of objects to save.
+ */
++ (void)saveAllInBackground:(NSArray *)objects;
+
+/*!
+ Saves a collection of objects all at once asynchronously and calls a callback when done.
+ @param objects The array of objects to save.
+ @param target The object to call selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithError:(NSError *)error. error will be nil on success and set if there was an error.
+ */
++ (void)saveAllInBackground:(NSArray *)objects withTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Saves a collection of objects all at once asynchronously and the block when done.
+ @param objects The array of objects to save.
+ @param block The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
++ (void)saveAllInBackground:(NSArray *)objects withBlock:(PFBooleanResultBlock)block;
+
+@end
42 Parse.framework/Headers/PFPointer.h
@@ -0,0 +1,42 @@
+// PFPointer.h
+// Copyright 2011 Parse, Inc. All rights reserved.
+
+#import <Foundation/Foundation.h>
+
+/*!
+ A class that defines a pointer to a PFObject.
+ */
+@interface PFPointer : NSObject <NSCopying> {
+ NSString *objectId;
+ NSString *className;
+}
+
+/*!
+ The object id.
+ */
+@property (nonatomic, retain) NSString *objectId;
+
+/*!
+ The object's class name.
+ */
+@property (nonatomic, retain) NSString *className;
+
+- (id)proxyForJson;
+
+/*!
+ Initializes the object with a class name and object id.
+ @param newClassName The class name.
+ @param newObjectId The object id.
+ */
+- (id)initWithClassName:(NSString *)newClassName objectId:(NSString *)newObjectId;
+
+/*!
+ Helper function to create a pointer.
+ @param newClassName The class name.
+ @param newObjectId The object id.
+ */
++ (PFPointer *)pointerWithClassName:(NSString *)newClassName objectId:(NSString *)newObjectId;
+
+- (id)copyWithZone:(NSZone *)zone;
+
+@end
175 Parse.framework/Headers/PFPush.h
@@ -0,0 +1,175 @@
+//
+// PFPush.h
+// Parse
+//
+// Created by Ilya Sukhar on 7/4/11.
+// Copyright 2011 Parse, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <AudioToolbox/AudioToolbox.h>
+#import "PFConstants.h"
+
+/*!
+ A class with convenience methods for push notifications.
+ */
+@interface PFPush : NSObject { }
+
+/*!
+ Subscribes the device to a channel of push notifications.
+ @param channel The channel to subscribe to.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns whether the subscribe succeeded.
+ */
++ (BOOL)subscribeToChannel:(NSString *)channel withError:(NSError **)error;
+
+/*!
+ Asynchronously subscribes the device to a channel of push notifications.
+ @param channel The channel to subscribe to.
+ */
++ (void)subscribeToChannelInBackground:(NSString *)channel;
+
+/*!
+ Asynchronously subscribes the device to a channel of push notifications and calls the given callback.
+ @param channel The channel to subscribe to.
+ @param target The object to call selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError *)error. error will be nil on success and set if there was an error. [result boolValue] will tell you whether the call succeeded or not.
+ */
++ (void)subscribeToChannelInBackground:(NSString *)channel withTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Unsubscribes the device to a channel of push notifications.
+ @param channel The channel to unsubscribe from.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns whether the unsubscribe succeeded.
+ */
++ (BOOL)unsubscribeFromChannel:(NSString *)channel withError:(NSError **)error;
+
+/*!
+ Asynchronously unsubscribes the device from a channel of push notifications.
+ @param channel The channel to unsubscribe from.
+ */
++ (void)unsubscribeFromChannelInBackground:(NSString *)channel;
+
+/*!
+ Asynchronously unsubscribes the device from a channel of push notifications and calls the given callback.
+ @param channel The channel to unsubscribe from.
+ @param target The object to call selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError *)error. error will be nil on success and set if there was an error. [result boolValue] will tell you whether the call succeeded or not.
+ */
++ (void)unsubscribeFromChannelInBackground:(NSString *)channel withTarget:(id)target selector:(SEL)selector;
+
+/*!
+ A default handler for push notifications while the app is active to mimic the behavior of iOS push notifications while the app is backgrounded or not running. Call this from didReceiveRemoteNotification.
+ @param userInfo The userInfo dictionary you get in didReceiveRemoteNotification.
+ */
++ (void)handlePush:(NSDictionary *)userInfo;
+
+/*!
+ Send a push message to a channel.
+ @param channel The channel to send to.
+ @param message The message to send.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns whether the send succeeded.
+ */
++ (BOOL)sendPushMessageToChannel:(NSString *)channel withMessage:(NSString *)message error:(NSError **)error;
+
+/*!
+ Asynchronously send a push message to a channel.
+ @param channel The channel to send to.
+ @param message The message to send.
+ */
++ (void)sendPushMessageToChannelInBackground:(NSString *)channel withMessage:(NSString *)message;
+
+/*!
+ Asynchronously send a push message to a channel.
+ @param channel The channel to send to.
+ @param message The message to send.
+ @param target The object to call selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError *)error. error will be nil on success and set if there was an error. [result boolValue] will tell you whether the call succeeded or not.
+ */
++ (void)sendPushMessageToChannelInBackground:(NSString *)channel withMessage:(NSString *)message target:(id)target selector:(SEL)selector;
+
+/*!
+ Send a push message with arbitrary data to a channel. See the guide for information about the dictionary structure.
+ @param channel The channel to send to.
+ @param data The data to send.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns whether the send succeeded.
+ */
++ (BOOL)sendPushDataToChannel:(NSString *)channel withData:(NSDictionary *)data error:(NSError **)error;
+
+/*!
+ Asynchronously send a push message with arbitrary data to a channel. See the guide for information about the dictionary structure.
+ @param channel The channel to send to.
+ @param data The data to send.
+ */
++ (void)sendPushDataToChannelInBackground:(NSString *)channel withData:(NSDictionary *)data;
+
+/*!
+ Asynchronously send a push message with arbitrary data to a channel. See the guide for information about the dictionary structure.
+ @param channel The channel to send to.
+ @param data The data to send.
+ @param target The object to call selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError *)error. error will be nil on success and set if there was an error. [result boolValue] will tell you whether the call succeeded or not.
+ */
++ (void)sendPushDataToChannelInBackground:(NSString *)channel withData:(NSDictionary *)data target:(id)target selector:(SEL)selector;
+
+/*!
+ Store the device token locally for push notifications. Usually called from you main app delegate's didRegisterForRemoteNotificationsWithDeviceToken.
+ @param deviceToken Either as an NSData straight from didRegisterForRemoteNotificationsWithDeviceToken or as an NSString if you converted it yourself.
+ */
++ (void)storeDeviceToken:(id)deviceToken;
+
+/*!
+ Get all the channels that this device is subscribed to.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns an NSSet containing all the channel names this device is subscribed to.
+ */
++ (NSSet *)getSubscribedChannels:(NSError **)error;
+
+/*!
+ Asynchronously get all the channels that this device is subscribed to.
+ @param target The object to call selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSSet *)result error:(NSError *)error. error will be nil on success and set if there was an error.
+ @result Returns an NSSet containing all the channel names this device is subscribed to.
+ */
++ (void)getSubscribedChannelsInBackgroundWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Asynchronously subscribes the device to a channel of push notifications and calls the given block.
+ @param channel The channel to subscribe to.
+ @param block The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
++ (void)subscribeToChannelInBackground:(NSString *)channel block:(PFBooleanResultBlock)block;
+
+/*!
+ Asynchronously unsubscribes the device from a channel of push notifications and calls the given block.
+ @param channel The channel to unsubscribe from.
+ @param block The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
++ (void)unsubscribeFromChannelInBackground:(NSString *)channel block:(PFBooleanResultBlock)block;
+
+/*!
+ Asynchronously sends a push message to a channel and calls the given block.
+ @param channel The channel to send to.
+ @param message The message to send.
+ @param block The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
++ (void)sendPushMessageToChannelInBackground:(NSString *)channel withMessage:(NSString *)message block:(PFBooleanResultBlock)block;
+
+/*!
+ Asynchronously sends a push message with arbitrary data to a channel and calls the given block. See the guide for information about the dictionary structure.
+ @param channel The channel to send to.
+ @param data The data to send.
+ @param block The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
++ (void)sendPushDataToChannelInBackground:(NSString *)channel withData:(NSDictionary *)data block:(PFBooleanResultBlock)block;
+
+/*!
+ Get all the channels that this device is subscribed to.
+ @param block The block to execute. The block should have the following argument signature: (NSSet *channels, NSError *error)
+ */
++ (void)getSubscribedChannelsInBackgroundWithBlock:(PFSetResultBlock)block;
+
+@end
323 Parse.framework/Headers/PFQuery.h
@@ -0,0 +1,323 @@
+// PFQuery.m
+// Copyright 2011 Parse, Inc. All rights reserved.
+
+#import <Foundation/Foundation.h>
+#import "PFGeoPoint.h"
+#import "PFObject.h"
+#import "PFUser.h"
+
+/*!
+ A class that defines a query that is used to query for PFObjects.
+ */
+@interface PFQuery : NSObject {
+ NSString *className;
+ NSMutableDictionary *where;
+ NSMutableArray *include;
+ NSNumber *limit;
+ NSNumber *skip;
+ NSString *order;
+ PFCachePolicy cachePolicy;
+}
+
+/*!
+ The class name to query for
+ */
+@property (nonatomic, retain) NSString *className;
+
+/*!
+ A limit on the number of objects to return.
+ */
+@property (nonatomic, retain) NSNumber *limit;
+
+/*!
+ The number of objects to skip before returning any.
+ */
+@property (nonatomic, retain) NSNumber *skip;
+
+/*!
+ The cache policy to use for requests.
+ */
+@property (readwrite, assign) PFCachePolicy cachePolicy;
+
+/*!
+ A string representing an ordering for the objects returned.
+ @deprecated Use orderByAscending: and orderByDescending: instead.
+ */
+@property (nonatomic, retain) NSString *order;
+
+/*!
+ Initializes the query with a class name.
+ @param newClassName The class name.
+ */
+- (id)initWithClassName:(NSString *)newClassName;
+
+/*!
+ Sort the results in ascending order with the given key.
+ @param key The key to order by.
+ */
+- (void)orderByAscending:(NSString *)key;
+
+/*!
+ Sort the results in descending order with the given key.
+ @param key The key to order by.
+ */
+- (void)orderByDescending:(NSString *)key;
+
+/*!
+ Add a where condition to the query.
+ @param key The key to search on
+ @param object The value to search on.
+ @deprecated Use whereKey:equalTo: instead.
+ */
+- (void)whereObject:(id)object forKey:(NSString *)key __attribute__ ((deprecated));
+
+/*!
+ Add a constraint to the query that requires a particular key's object to be equal to the provided object.
+ @param key The key to be constrained.
+ @param object The object that must be equalled.
+ */
+- (void)whereKey:(NSString *)key equalTo:(id)object;
+
+/*!
+ Add a constraint to the query that requires a particular key's object to be less than the provided object.
+ @param key The key to be constrained.
+ @param object The object that provides an upper bound.
+ */
+- (void)whereKey:(NSString *)key lessThan:(id)object;
+
+/*!
+ Add a constraint to the query that requires a particular key's object to be less than or equal to the provided object.
+ @param key The key to be constrained.
+ @param object The object that must be equalled.
+ */
+- (void)whereKey:(NSString *)key lessThanOrEqualTo:(id)object;
+
+/*!
+ Add a constraint to the query that requires a particular key's object to be greater than the provided object.
+ @param key The key to be constrained.
+ @param object The object that must be equalled.
+ */
+- (void)whereKey:(NSString *)key greaterThan:(id)object;
+
+/*!
+ Add a constraint to the query that requires a particular key's object to be greater than or equal to the provided object.
+ @param key The key to be constrained.
+ @param object The object that must be equalled.
+ */
+- (void)whereKey:(NSString *)key greaterThanOrEqualTo:(id)object;
+
+/*!
+ Add a constraint to the query that requires a particular key's object to be not equal to the provided object.
+ @param key The key to be constrained.
+ @param object The object that must not be equalled.
+ */
+- (void)whereKey:(NSString *)key notEqualTo:(id)object;
+
+/*!
+ Add a constraint to the query that requires a particular key's object to be contained in the provided array.
+ @param key The key to be constrained.
+ @param array The possible values for the key's object.
+ */
+- (void)whereKey:(NSString *)key containedIn:(NSArray *)array;
+
+/*!
+ Add a constraint to the query that requires a particular key's coordinates (specified via PFGeoPoint) be near
+ a reference point. Distance is calculated based on angular distance on a sphere. Results will be sorted by distance
+ from reference point.
+ @param key The key to be constrained.
+ @param geopoint The reference point. A PFGeoPoint.
+ */
+- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint;
+
+/*!
+ Add a constraint to the query that requires a particular key's coordinates (specified via PFGeoPoint) be near
+ a reference point and within the maximum distance specified (in miles). Distance is calculated based on
+ a spherical coordinate system. Results will be sorted by distance (nearest to farthest) from the reference point.
+ @param key The key to be constrained.
+ @param geopoint The reference point. A PFGeoPoint.
+ @param maxDistance Maximum distance in miles.
+ */
+- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinMiles:(double)maxDistance;
+
+/*!
+ Add a constraint to the query that requires a particular key's coordinates (specified via PFGeoPoint) be near
+ a reference point and within the maximum distance specified (in kilometers). Distance is calculated based on
+ a spherical coordinate system. Results will be sorted by distance (nearest to farthest) from the reference point.
+ @param key The key to be constrained.
+ @param geopoint The reference point. A PFGeoPoint.
+ @param maxDistance Maximum distance in kilometers.
+ */
+- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinKilometers:(double)maxDistance;
+
+/*!
+ Add a constraint to the query that requires a particular key's coordinates (specified via PFGeoPoint) be near
+ a reference point and within the maximum distance specified (in radians). Distance is calculated based on
+ angular distance on a sphere. Results will be sorted by distance (nearest to farthest) from the reference point.
+ @param key The key to be constrained.
+ @param geopoint The reference point. A PFGeoPoint.
+ @param maxDistance Maximum distance in radians.
+ */
+- (void)whereKey:(NSString *)key nearGeoPoint:(PFGeoPoint *)geopoint withinRadians:(double)maxDistance;
+
+/*!
+ Add a regular expression constraint for finding string values that match the provided regular expression.
+ This may be slow for large datasets.
+ @param key The key that the string to match is stored in.
+ @param regex The regular expression pattern to match.
+ */
+- (void)whereKey:(NSString *)key matchesRegex:(NSString *)regex;
+
+/*!
+ Add a constraint for finding string values that contain a provided substring.
+ This will be slow for large datasets.
+ @param key The key that the string to match is stored in.
+ @param substring The substring that the value must contain.
+ */
+- (void)whereKey:(NSString *)key containsString:(NSString *)substring;
+
+/*!
+ Add a constraint for finding string values that start with a provided prefix.
+ This will use smart indexing, so it will be fast for large datasets.
+ @param key The key that the string to match is stored in.
+ @param prefix The substring that the value must start with.
+ */
+- (void)whereKey:(NSString *)key hasPrefix:(NSString *)prefix;
+
+/*!
+ Add a constraint for finding string values that end with a provided suffix.
+ This will be slow for large datasets.
+ @param key The key that the string to match is stored in.
+ @param suffix The substring that the value must end with.
+ */
+- (void)whereKey:(NSString *)key hasSuffix:(NSString *)suffix;
+
+/*!
+ Make the query include PFObjects that have a reference stored at the provided key.
+ This has an effect similar to a join.
+ @param key The key to load child PFObjects for.
+ */
+- (void)includeKey:(NSString *)key;
+
+/*!
+ Finds objects based on the constructed query.
+ @result Returns an array of PFObjects that were found.
+ */
+- (NSArray *)findObjects;
+
+/*!
+ Finds objects based on the constructed query and sets an error if there was one.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns an array of PFObjects that were found.
+ */
+- (NSArray *)findObjects:(NSError **)error;
+
+/*!
+ Finds objects asynchronously and calls the given callback with the results.
+ @param target The object to call the selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSArray *)result error:(NSError *)error. result will be nil if error is set and vice versa.
+ */
+- (void)findObjectsInBackgroundWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Counts objects based on the constructed query.
+ @result Returns the number of PFObjects that match the query, or -1 if there is an error.
+ */
+- (NSInteger)countObjects;
+
+/*!
+ Counts objects based on the constructed query and sets an error if there was one.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result Returns the number of PFObjects that match the query, or -1 if there is an error.
+ */
+- (NSInteger)countObjects:(NSError **)error;
+
+/*!
+ Counts objects asynchronously and calls the given callback with the count.
+ @param target The object to call the selector on.
+ @param selector The selector to call. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError *)error. */
+- (void)countObjectsInBackgroundWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Returns a PFObject with the given id.
+ @param objectId The id of the object that is being requested.
+ @result The PFObject if found. Returns nil if the object isn't found, or if there was an error.
+ */
+- (PFObject *)getObjectWithId:(NSString *)objectId;
+
+/*!
+ Returns a PFObject with the given id and sets an error if necessary.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result The PFObject if found. Returns nil if the object isn't found, or if there was an error.
+ */
+- (PFObject *)getObjectWithId:(NSString *)objectId error:(NSError **)error;
+
+/*!
+ Gets a PFObject asynchronously.
+ @param objectId The id of the object being requested.
+ @param target The target for the callback selector.
+ @param selector The selector for the callback. It should have the following signature: (void)callbackWithResult:(PFObject *)result error:(NSError *)error. result will be nil if error is set and vice versa.
+ */
+- (void)getObjectInBackgroundWithId:(NSString *)objectId target:(id)target selector:(SEL)selector;
+
+/*!
+ Returns a PFObject with a given class and id.
+ @param objectClass The class name for the object that is being requested.
+ @param objectId The id of the object that is being requested.
+ @result The PFObject if found. Returns nil if the object isn't found, or if there was an error.
+ */
++ (PFObject *)getObjectOfClass:(NSString *)objectClass objectId:(NSString *)objectId;
+
+/*!
+ Returns a PFObject with a given class and id and sets an error if necessary.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result The PFObject if found. Returns nil if the object isn't found, or if there was an error.
+ */
++ (PFObject *)getObjectOfClass:(NSString *)objectClass objectId:(NSString *)objectId error:(NSError **)error;
+
+/*!
+ Returns a PFQuery for a given class.
+ @param className The class to query on.
+ @return A PFQuery object.
+ */
++ (PFQuery *)queryWithClassName:(NSString *)className;
+
+/*!
+ Returns a PFUser with a given id.
+ @param objectId The id of the object that is being requested.
+ @result The PFUser if found. Returns nil if the object isn't found, or if there was an error.
+ */
++ (PFUser *)getUserObjectWithId:(NSString *)objectId;
+
+/*!
+ Returns a PFUser with a given class and id and sets an error if necessary.
+ @param error Pointer to an NSError that will be set if necessary.
+ @result The PFUser if found. Returns nil if the object isn't found, or if there was an error.
+ */
++ (PFUser *)getUserObjectWithId:(NSString *)objectId error:(NSError **)error;
+
+/*!
+ Returns a PFQuery for a PFUser.
+ @return A PFQuery object.
+ */
++ (PFQuery *)queryForUser;
+
+/*!
+ Finds objects asynchronously and calls the given block with the results.
+ @param block The block to execute. The block should have the following argument signature:(NSArray *objects, NSError *error)
+ */
+- (void)findObjectsInBackgroundWithBlock:(PFArrayResultBlock)block;
+
+/*!
+ Counts objects asynchronously and calls the given block with the counts.
+ @param block The block to execute. The block should have the following argument signature:
+ (int count, NSError *error)
+ */
+- (void)countObjectsInBackgroundWithBlock:(PFIntegerResultBlock)block;
+
+/*!
+ Gets a PFObject asynchronously and calls the given block with the result.
+ @param block The block to execute. The block should have the following argument signature: (NSArray *object, NSError *error)
+ */
+- (void)getObjectInBackgroundWithId:(NSString *)objectId block:(PFObjectResultBlock)block;
+
+@end
127 Parse.framework/Headers/PFQueryTableViewController.h
@@ -0,0 +1,127 @@
+//
+// PFUITableViewController.h
+// Posse
+//
+// Created by James Yu on 11/20/11.
+// Copyright (c) 2011 Parse Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "Parse.h"
+#import "PF_EGORefreshTableHeaderView.h"
+#import "PF_MBProgressHUD.h"
+
+@interface PFQueryTableViewController : UITableViewController <UITableViewDataSource, UITableViewDelegate, PF_EGORefreshTableHeaderDelegate>
+
+/// The class of the PFObject this table will use as a datasource
+@property (retain, nonatomic) NSString *className;
+
+/// The array of PFObjects that is used to drive the UITableView data source
+@property (retain, nonatomic) NSMutableArray *objects;
+
+/// The key to use to display for the cell text label. This won't apply if you override tableView:cellForRowAtIndexPath:object:
+@property (retain, nonatomic) NSString *keyToDisplay;
+
+/// Whether the table should use the built-in pull-to-refresh feature (default:YES)
+@property (assign, nonatomic) BOOL pullToRefreshEnabled;
+
+/// Whether the table should use the built-in pagination feature (default:YES)
+@property (assign, nonatomic) BOOL paginationEnabled;
+
+/// The number of objects to show per page (default: 25)
+@property (assign, nonatomic) NSUInteger objectsPerPage;
+
+/// Whether the table is actively loading new data from the server
+@property (assign, nonatomic) BOOL isLoading;
+
+/// When isLoading is true, this variable reflects the page that is loading
+@property (assign, nonatomic) NSInteger pageThatIsLoading;
+
+/*!
+ Called when objects have loaded from Parse. If you override this method, you must
+ call [super objectsDidLoad] in your implementation.
+ @param error The Parse error from running the PFQuery, if there was any.
+*/
+- (void)objectsDidLoad:(NSError *)error;
+
+/*!
+ Called when objects will loaded from Parse. If you override this method, you must
+ call [super objectsWillLoad] in your implementation.
+*/
+- (void)objectsWillLoad;
+
+/*!
+ Initializes with a class name of the PFObjects that will be associated with this table.
+ @param style The UITableViewStyle for the table
+ @param aClassName The class name of the PFObjects that this table will display
+ @result The initialized PFUITableViewController
+*/
+- (id)initWithStyle:(UITableViewStyle)style className:(NSString *)aClassName;
+
+/*!
+ Initializes with a class name of the PFObjects that will be associated with this table.
+ @param aClassName The class name of the PFObjects that this table will display
+ @result The initialized PFUITableViewController
+ */
+- (id)initWithClassName:(NSString *)aClassName;
+
+/*!
+ Returns an object at a particular indexPath. The default impementation returns
+ the object at indexPath.row. If you want to return objects in a different
+ indexPath order, like for sections, override this method.
+ @param indexPath The indexPath
+ @result The object at the specified index
+*/
+- (PFObject *)objectAtIndex:(NSIndexPath *)indexPath;
+
+/*!
+ Override to construct your own custom PFQuery to get the objects.
+ @result PFQuery that loadObjects will use to the objects for this table.
+*/
+- (PFQuery *)queryForTable;
+
+/*!
+ Clears the table of all objects.
+*/
+- (void)clear;
+
+/*!
+ Clears the table and loads the first page of objects.
+ */
+- (void)loadObjects;
+
+/*!
+ Loads the objects of the className at the specified page and appends it to the
+ objects already loaded and refreshes the table.
+ @param page The page of objects to load.
+ @param clear Whether to clear the table after receiving the objects.
+ */
+- (void)loadObjects:(NSInteger)page clear:(BOOL)clear;
+
+/*!
+ Loads the next page of objects, appends to table, and refreshes.
+ */
+- (void)loadNextPage;
+
+/*!
+ Override this method to customize each cell given a PFObject that is loaded. If you
+ don't override this method, it will use a default style cell and display either
+ the first data key from the object, or it will display the key as specified
+ with keyToDisplay.
+
+ @param tableView The table view object associated with this controller.
+ @param object The PFObject that is associated with the cell.
+ @result The cell that represents this object.
+*/
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object;
+
+/*!
+ Override this method to customize the cell that allows the user to load the
+ next page when pagination is turned on.
+ @param tableView The table view object associated with this controller.
+ @param indexPath The indexPath of the cell.
+ @result The cell that allows the user to paginate.
+ */
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForNextPageAtIndexPath:(NSIndexPath *)indexPath;
+
+@end
310 Parse.framework/Headers/PFUser.h
@@ -0,0 +1,310 @@
+// PFUser.h
+// Copyright 2011 Parse, Inc. All rights reserved.
+
+#import <Foundation/Foundation.h>
+#import "PFObject.h"
+#import "PF_Facebook.h"
+
+/*!
+ A Parse Framework User Object that is a local representation of a user persisted to the Parse cloud. This class
+ is a subclass of a PFObject, and retains the same functionality of a PFObject, but also extends it with various
+ user specific methods, like authentication, signing up, and validation uniqueness.
+ */
+
+
+@interface PFUser : PFObject {
+ NSString *password;
+ NSString *sessionToken;
+ NSString *facebookId;
+ NSString *facebookAccessToken;
+ NSDate *facebookExpirationDate;
+ BOOL isNew;
+@private
+ BOOL isCurrentUser;
+ BOOL deleteFacebook;
+}
+
+/**
+ The password for the PFUser. This will not be filled in from the server with
+ the password. It is only meant to be set.
+*/
+@property (nonatomic, retain) NSString *password;
+
+/// The session token for the PFUser. This is set by the server upon successful authentication.
+@property (nonatomic, retain) NSString *sessionToken;
+
+/// The Facebook access token. This is set whenever a PFUser successfully authenticates via Facebook.
+@property (readonly, retain) NSString *facebookAccessToken;
+
+/// The Facebook token expiration date.
+@property (readonly, retain) NSDate *facebookExpirationDate;
+
+/// The Facebook id of the PFUser.
+@property (readonly, retain) NSString *facebookId;
+
+/// Whether the PFUser was just created from a request. This is only set after a Facebook login.
+@property (readonly, assign) BOOL isNew;
+
+/// The username for the PFUser.
+@property (nonatomic, retain) NSString *username;
+
+/// The email for the PFUser.
+@property (nonatomic, retain) NSString *email;
+
+/*!
+ Initializes a new PFUser object.
+ @result Returns a new PFUser object.
+ */
+- (id)init;
+
+/*!
+ Creates a new PFUser object.
+ @result Returns a new PFUser object.
+ */
++ (PFUser *)user;
+
+/*!
+ Gets the currently logged in user from disk and returns an instance of it.
+ @result Returns a PFUser that is the currently logged in user. If there is none, returns nil.
+ */
++ (id)currentUser;
+
+/*!
+ Makes a request to login a user with specified credentials. Returns an instance
+ of the successfully logged in PFUser. This will also cache the user locally so
+ that calls to userFromCurrentUser will use the latest logged in user.
+ @param username The username of the user.
+ @param password The password of the user.
+ @result Returns an instance of the PFUser on success. If login failed for either wrong password or wrong username, returns nil.
+ */
++ (PFUser *)logInWithUsername:(NSString *)username
+ password:(NSString *)password;
+
+/*!
+ Makes a request to login a user with specified credentials. Returns an
+ instance of the successfully logged in PFUser. This will also cache the user
+ locally so that calls to userFromCurrentUser will use the latest logged in user.
+ @param username The username of the user.
+ @param password The password of the user.
+ @param error The error object to set on error.
+ @result Returns an instance of the PFUser on success. If login failed for either wrong password or wrong username, returns nil.
+ */
++ (PFUser *)logInWithUsername:(NSString *)username
+ password:(NSString *)password
+ error:(NSError **)error;
+
+/*!
+ Makes an asynchronous request to login a user with specified credentials.
+ Returns an instance of the successfully logged in PFUser. This will also cache
+ the user locally so that calls to userFromCurrentUser will use the latest logged in user.
+ @param username The username of the user.
+ @param password The password of the user.
+ */
++ (void)logInWithUsernameInBackground:(NSString *)username
+ password:(NSString *)password;
+
+/*!
+ Makes an asynchronous request to login a user with specified credentials.
+ Returns an instance of the successfully logged in PFUser. This will also cache
+ the user locally so that calls to userFromCurrentUser will use the latest logged in user.
+ The selector for the callback should look like: myCallback:(PFUser *)user error:(NSError **)error
+ @param username The username of the user.
+ @param password The password of the user.
+ @param target Target object for the selector.
+ @param selector The selector that will be called when the asynchrounous request is complete.
+ */
++ (void)logInWithUsernameInBackground:(NSString *)username
+ password:(NSString *)password
+ target:(id)target
+ selector:(SEL)selector;
+
+
+/*!
+ Gets the instance of the Facebook object (from the Facebook SDK) that Parse uses.
+ @result The Facebook instance
+ */
++ (PF_Facebook *)facebook;
+
+/*!
+ Gets the instance of the Facebook object (from the Facebook SDK) that Parse uses.
+ @param delegate Specify your own delegate for the Facebook object.
+ @result The Facebook instance
+ */
++ (PF_Facebook *)facebookWithDelegate:(id<PF_FBSessionDelegate>)delegate;
+
+/*!
+ Logs in a user using Facebook. This method delegates to the Facebook SDK to authenticate
+ the user, and then automatically logs in (or creates, in the case where it is a new user)
+ a PFUser. The selector for the callback should look like: (PFUser *)user error:(NSError **)error
+
+ @param permissions The permissions required for Facebook log in. This passed to the authorize method on
+ the Facebook instance.
+ @param target Target object for the selector
+ @param selector The selector that will be called when the asynchrounous request is complete.
+ */
++ (void)logInWithFacebook:(NSArray *)permissions target:(id)target selector:(SEL)selector;
+
+/*!
+ Links Facebook to an existing PFUser. This method delegates to the Facebook SDK to authenticate
+ the user, and then automatically links the account to the PFUser.
+ The selector for the callback should look like: (NSNumber *)result error:(NSError *)error
+
+ @param permissions The permissions required for Facebook log in. This passed to the authorize method on
+ the Facebook instance.
+ @param target Target object for the selector
+ @param selector The selector that will be called when the asynchrounous request is complete.
+ */
+- (void)linkToFacebook:(NSArray *)permissions target:(id)target selector:(SEL)selector;
+
+/*!
+ Unlinks the PFUser from a Facebook account.
+ @result Returns true if the unlink was successful.
+ */
+- (BOOL)unlinkFromFacebook;
+
+/*!
+ Unlinks the PFUser from a Facebook account.
+ @param error Error object to set on error.
+ @result Returns true if the unlink was successful.
+ */
+- (BOOL)unlinkFromFacebookWithError:(NSError **)error;
+
+/*!
+ Makes an asynchronous request to unlink a user from a Facebook account.
+ @param target Target object for the selector
+ @param selector The selector that will be called when the asynchrounous request is complete.
+ */
+- (void)unlinkFromFacebookInBackgroundWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Send a password reset request for a specified email. If a user account exists with that email,
+ an email will be sent to that address with instructions on how to reset their password.
+ @param email Email of the account to send a reset password request.
+ @result Returns true if the reset email request is successful. False if no account was found for the email address.
+ */
++ (BOOL)requestPasswordResetForEmail:(NSString *)email;
+
+/*!
+ Send a password reset request for a specified email and sets an error object. If a user
+ account exists with that email, an email will be sent to that address with instructions
+ on how to reset their password.
+ @param email Email of the account to send a reset password request.
+ @param error Error object to set on error.
+ @result Returns true if the reset email request is successful. False if no account was found for the email address.
+ */
++ (BOOL)requestPasswordResetForEmail:(NSString *)email error:(NSError **)error;
+
+/*!
+ Send a password reset request asynchronously for a specified email and sets an
+ error object. If a user account exists with that email, an email will be sent to
+ that address with instructions on how to reset their password.
+ @param email Email of the account to send a reset password request.
+ */
++ (void)requestPasswordResetForEmailInBackground:(NSString *)email;
+
+/*!
+ Send a password reset request asynchronously for a specified email and sets an error object.
+ If a user account exists with that email, an email will be sent to that address with instructions
+ on how to reset their password.
+ @param email Email of the account to send a reset password request.
+ @param target Target object for the selector.
+ @param selector The selector that will be called when the asynchronous request is complete. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError **)error. error will be nil on success and set if there was an error. [result boolValue] will tell you whether the call succeeded or not.
+ */
++ (void)requestPasswordResetForEmailInBackground:(NSString *)email withTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Logs out the currently logged in user on disk.
+ */
++ (void)logOut;
+
+/*!
+ Whether the user is an authenticated object for the device. An authenticated PFUser is one that is obtained via
+ a signUp or logIn method. An authenticated object is required in order to save (with altered values) or delete it.
+ @result Returns whether the user is authenticated.
+ */
+- (BOOL)isAuthenticated;
+
+/*!
+ Whether the user has their account linked to Facebook.
+ @result True if the user has their account linked to Facebook.
+*/
+- (BOOL)hasFacebook;
+
+/*!
+ Signs up the user. Make sure that password and username are set. This will also enforce that the username isn't already taken.
+ @result Returns true if the sign up was successful.
+ */
+- (BOOL)signUp;
+
+/*!
+ Signs up the user. Make sure that password and username are set. This will also enforce that the username isn't already taken.
+ @param error Error object to set on error.
+ @result Returns whether the sign up was successful.
+ */
+- (BOOL)signUp:(NSError **)error;
+
+/*!
+ Signs up the user asynchronously. Make sure that password and username are set. This will also enforce that the username isn't already taken.
+ */
+- (void)signUpInBackground;
+
+/*!
+ Signs up the user asynchronously. Make sure that password and username are set. This will also enforce that the username isn't already taken.
+ @param target Target object for the selector.
+ @param selector The selector that will be called when the asynchrounous request is complete. It should have the following signature: (void)callbackWithResult:(NSNumber *)result error:(NSError **)error. error will be nil on success and set if there was an error. [result boolValue] will tell you whether the call succeeded or not.
+ */
+- (void)signUpInBackgroundWithTarget:(id)target selector:(SEL)selector;
+
+/*!
+ Makes an asynchronous request to login a user with specified credentials.
+ Returns an instance of the successfully logged in PFUser. This will also cache
+ the user locally so that calls to userFromCurrentUser will use the latest logged in user.
+ @param username The username of the user.
+ @param password The password of the user.
+ @param block The block to execute. The block should have the following argument signature: (PFUser *user, NSError *error)
+ */
++ (void)logInWithUsernameInBackground:(NSString *)username password:(NSString *)password block:(PFUserResultBlock)block;
+
+/*!
+ Send a password reset request asynchronously for a specified email.
+ If a user account exists with that email, an email will be sent to that address with instructions
+ on how to reset their password.
+ @param email Email of the account to send a reset password request.
+ @param block The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
++ (void)requestPasswordResetForEmailInBackground:(NSString *)email block:(PFBooleanResultBlock)block;
+
+/*!
+ Signs up the user asynchronously. Make sure that password and username are set. This will also enforce that the username isn't already taken.
+ @param block The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
+- (void)signUpInBackgroundWithBlock:(PFBooleanResultBlock)block;
+
+/*!
+ Logs in a user using Facebook. This method delegates to the Facebook SDK to authenticate
+ the user, and then automatically logs in (or creates, in the case where it is a new user)
+ a PFUser.
+ @param permissions The permissions required for Facebook log in. This passed to the authorize method on
+ the Facebook instance.
+ @param block The block to execute. The block should have the following argument signature:
+ (PFUser *user, NSError *error)
+ */
++ (void)logInWithFacebook:(NSArray *)permissions block:(PFUserResultBlock)block;
+
+/*!
+ Links Facebook to an existing PFUser. This method delegates to the Facebook SDK to authenticate
+ the user, and then automatically links the account to the PFUser.
+ @param permissions The permissions required for Facebook log in. This passed to the authorize method on
+ the Facebook instance.
+ @param block The block to execute. The block should have the following argument signature:
+ (BOOL *success, NSError *error)
+ */
+- (void)linkToFacebook:(NSArray *)permissions block:(PFBooleanResultBlock)block;
+
+/*!
+ Makes an asynchronous request to unlink a user from a Facebook account.
+ @param block The block to execute. The block should have the following argument signature: (BOOL succeeded, NSError *error)
+ */
+- (void)unlinkFromFacebookWithBlock:(PFBooleanResultBlock)block;
+
+@end
63 Parse.framework/Headers/PF_EGORefreshTableHeaderView.h
@@ -0,0 +1,63 @@
+//
+// EGORefreshTableHeaderView.h
+// Demo
+//
+// Created by Devin Doty on 10/14/09October14.
+// Copyright 2009 enormego. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+#import <UIKit/UIKit.h>
+#import <QuartzCore/QuartzCore.h>
+
+typedef enum{
+ EGOOPullRefreshPulling = 0,
+ EGOOPullRefreshNormal,
+ EGOOPullRefreshLoading,
+} PFUI_EGOPullRefreshState;
+
+@protocol PF_EGORefreshTableHeaderDelegate;
+@interface PF_EGORefreshTableHeaderView : UIView {
+
+ id _delegate;
+ PFUI_EGOPullRefreshState _state;
+
+ UILabel *_lastUpdatedLabel;
+ UILabel *_statusLabel;
+ CALayer *_arrowImage;
+ UIActivityIndicatorView *_activityView;
+
+
+}
+
+@property(nonatomic,assign) id <PF_EGORefreshTableHeaderDelegate> delegate;
+
+- (void)refreshLastUpdatedDate;
+- (void)egoRefreshScrollViewDidScroll:(UIScrollView *)scrollView;
+- (void)egoRefreshScrollViewDidEndDragging:(UIScrollView *)scrollView;
+- (void)egoRefreshScrollViewDataSourceDidFinishedLoading:(UIScrollView *)scrollView;
+
+@end
+@protocol PF_EGORefreshTableHeaderDelegate
+- (void)egoRefreshTableHeaderDidTriggerRefresh:(PF_EGORefreshTableHeaderView*)view;
+- (BOOL)egoRefreshTableHeaderDataSourceIsLoading:(PF_EGORefreshTableHeaderView*)view;
+@optional
+- (NSDate*)egoRefreshTableHeaderDataSourceLastUpdated:(PF_EGORefreshTableHeaderView*)view;
+@end
21 Parse.framework/Headers/PF_FBConnect.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2010 Facebook
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#include "PF_Facebook.h"
+#include "PF_FBDialog.h"
+#include "PF_FBLoginDialog.h"
+#include "PF_FBRequest.h"
167 Parse.framework/Headers/PF_FBDialog.h
@@ -0,0 +1,167 @@
+/*
+ * Copyright 2010 Facebook
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+@protocol PF_FBDialogDelegate;
+
+/**
+ * Do not use this interface directly, instead, use dialog in Facebook.h
+ *
+ * Facebook dialog interface for start the facebook webView UIServer Dialog.
+ */
+
+@interface PF_FBDialog : UIView <UIWebViewDelegate> {
+ id<PF_FBDialogDelegate> _delegate;
+ NSMutableDictionary *_params;
+ NSString * _serverURL;
+ NSURL* _loadingURL;
+ UIWebView* _webView;
+ UIActivityIndicatorView* _spinner;
+ UIImageView* _iconView;
+ UILabel* _titleLabel;
+ UIButton* _closeButton;
+ UIDeviceOrientation _orientation;
+ BOOL _showingKeyboard;
+
+ // Ensures that UI elements behind the dialog are disabled.
+ UIView* _modalBackgroundView;
+}
+
+/**
+ * The delegate.
+ */
+@property(nonatomic,assign) id<PF_FBDialogDelegate> delegate;
+
+/**
+ * The parameters.
+ */
+@property(nonatomic, retain) NSMutableDictionary* params;
+
+/**
+ * The title that is shown in the header atop the view.
+ */
+@property(nonatomic,copy) NSString* title;
+
+- (NSString *) getStringFromUrl: (NSString*) url needle:(NSString *) needle;
+
+- (id)initWithURL: (NSString *) loadingURL
+ params: (NSMutableDictionary *) params
+ delegate: (id <PF_FBDialogDelegate>) delegate;
+
+/**
+ * Displays the view with an animation.
+ *
+ * The view will be added to the top of the current key window.
+ */
+- (void)show;
+
+/**
+ * Displays the first page of the dialog.
+ *
+ * Do not ever call this directly. It is intended to be overriden by subclasses.
+ */
+- (void)load;
+
+/**
+ * Displays a URL in the dialog.
+ */
+- (void)loadURL:(NSString*)url
+ get:(NSDictionary*)getParams;
+
+/**
+ * Hides the view and notifies delegates of success or cancellation.
+ */
+- (void)dismissWithSuccess:(BOOL)success animated:(BOOL)animated;
+
+/**
+ * Hides the view and notifies delegates of an error.
+ */
+- (void)dismissWithError:(NSError*)error animated:(BOOL)animated;
+
+/**
+ * Subclasses may override to perform actions just prior to showing the dialog.
+ */
+- (void)dialogWillAppear;
+
+/**
+ * Subclasses may override to perform actions just after the dialog is hidden.
+ */
+- (void)dialogWillDisappear;
+
+/**
+ * Subclasses should override to process data returned from the server in a 'fbconnect' url.
+ *
+ * Implementations must call dismissWithSuccess:YES at some point to hide the dialog.
+ */
+- (void)dialogDidSucceed:(NSURL *)url;
+
+/**
+ * Subclasses should override to process data returned from the server in a 'fbconnect' url.
+ *
+ * Implementations must call dismissWithSuccess:YES at some point to hide the dialog.
+ */
+- (void)dialogDidCancel:(NSURL *)url;
+@end
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+/*
+ *Your application should implement this delegate
+ */
+@protocol PF_FBDialogDelegate <NSObject>
+
+@optional
+
+/**
+ * Called when the dialog succeeds and is about to be dismissed.
+ */
+- (void)dialogDidComplete:(PF_FBDialog *)dialog;
+
+/**
+ * Called when the dialog succeeds with a returning url.
+ */
+- (void)dialogCompleteWithUrl:(NSURL *)url;
+
+/**
+ * Called when the dialog get canceled by the user.
+ */
+- (void)dialogDidNotCompleteWithUrl:(NSURL *)url;
+
+/**
+ * Called when the dialog is cancelled and is about to be dismissed.
+ */
+- (void)dialogDidNotComplete:(PF_FBDialog *)dialog;
+
+/**
+ * Called when dialog failed to load due to an error.
+ */
+- (void)dialog:(PF_FBDialog*)dialog didFailWithError:(NSError *)error;
+
+/**
+ * Asks if a link touched by a user should be opened in an external browser.
+ *
+ * If a user touches a link, the default behavior is to open the link in the Safari browser,
+ * which will cause your app to quit. You may want to prevent this from happening, open the link
+ * in your own internal browser, or perhaps warn the user that they are about to leave your app.
+ * If so, implement this method on your delegate and return NO. If you warn the user, you
+ * should hold onto the URL and once you have received their acknowledgement open the URL yourself
+ * using [[UIApplication sharedApplication] openURL:].
+ */
+- (BOOL)dialog:(PF_FBDialog*)dialog shouldOpenURLInExternalBrowser:(NSURL *)url;
+
+@end
48 Parse.framework/Headers/PF_FBLoginDialog.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2010 Facebook
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#import "PF_FBDialog.h"
+
+@protocol PF_FBLoginDialogDelegate;
+
+/**
+ * Do not use this interface directly, instead, use authorize in Facebook.h
+ *
+ * Facebook Login Dialog interface for start the facebook webView login dialog.
+ * It start pop-ups prompting for credentials and permissions.
+ */
+
+@interface PF_FBLoginDialog : PF_FBDialog {
+ id<PF_FBLoginDialogDelegate> _loginDelegate;
+}
+
+-(id) initWithURL:(NSString *) loginURL
+ loginParams:(NSMutableDictionary *) params
+ delegate:(id <PF_FBLoginDialogDelegate>) delegate;
+@end
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+@protocol PF_FBLoginDialogDelegate <NSObject>
+
+- (void)fbDialogLogin:(NSString*)token expirationDate:(NSDate*)expirationDate;
+
+- (void)fbDialogNotLogin:(BOOL)cancelled;
+
+@end
+
+
116 Parse.framework/Headers/PF_FBRequest.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2010 Facebook
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+@protocol PF_FBRequestDelegate;
+
+/**
+ * Do not use this interface directly, instead, use method in Facebook.h
+ */
+@interface PF_FBRequest : NSObject {
+ id<PF_FBRequestDelegate> _delegate;
+ NSString* _url;
+ NSString* _httpMethod;
+ NSMutableDictionary* _params;
+ NSURLConnection* _connection;
+ NSMutableData* _responseText;
+}
+
+
+@property(nonatomic,assign) id<PF_FBRequestDelegate> delegate;
+
+/**
+ * The URL which will be contacted to execute the request.
+ */
+@property(nonatomic,copy) NSString* url;
+
+/**
+ * The API method which will be called.
+ */
+@property(nonatomic,copy) NSString* httpMethod;
+
+/**
+ * The dictionary of parameters to pass to the method.
+ *
+ * These values in the dictionary will be converted to strings using the
+ * standard Objective-C object-to-string conversion facilities.
+ */
+@property(nonatomic,retain) NSMutableDictionary* params;
+@property(nonatomic,assign) NSURLConnection* connection;
+@property(nonatomic,assign) NSMutableData* responseText;
+
+
++ (NSString*)serializeURL:(NSString *)baseUrl
+ params:(NSDictionary *)params;
+
++ (NSString*)serializeURL:(NSString *)baseUrl
+ params:(NSDictionary *)params
+ httpMethod:(NSString *)httpMethod;
+
++ (PF_FBRequest*)getRequestWithParams:(NSMutableDictionary *) params
+ httpMethod:(NSString *) httpMethod
+ delegate:(id<PF_FBRequestDelegate>)delegate
+ requestURL:(NSString *) url;
+- (BOOL) loading;
+
+- (void) connect;
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+ *Your application should implement this delegate
+ */
+@protocol PF_FBRequestDelegate <NSObject>
+
+@optional
+
+/**
+ * Called just before the request is sent to the server.
+ */
+- (void)requestLoading:(PF_FBRequest *)request;
+
+/**
+ * Called when the server responds and begins to send back data.
+ */
+- (void)request:(PF_FBRequest *)request didReceiveResponse:(NSURLResponse *)response;
+
+/**
+ * Called when an error prevents the request from completing successfully.
+ */
+- (void)request:(PF_FBRequest *)request didFailWithError:(NSError *)error;
+
+/**
+ * Called when a request returns and its response has been parsed into
+ * an object.
+ *
+ * The resulting object may be a dictionary, an array, a string, or a number,
+ * depending on thee format of the API response.
+ */
+- (void)request:(PF_FBRequest *)request didLoad:(id)result;
+
+/**
+ * Called when a request returns a response.
+ *
+ * The result object is the raw response from the server of type NSData
+ */
+- (void)request:(PF_FBRequest *)request didLoadRawResponse:(NSData *)data;
+
+@end
+
112 Parse.framework/Headers/PF_Facebook.h
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2010 Facebook
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#import "PF_FBLoginDialog.h"
+#import "PF_FBRequest.h"
+
+@protocol PF_FBSessionDelegate;
+
+/**
+ * Main Facebook interface for interacting with the Facebook developer API.
+ * Provides methods to log in and log out a user, make requests using the REST
+ * and Graph APIs, and start user interface interactions (such as
+ * pop-ups promoting for credentials, permissions, stream posts, etc.)
+ */
+@interface PF_Facebook : NSObject<PF_FBLoginDialogDelegate>{
+ NSString* _accessToken;
+ NSDate* _expirationDate;
+ id<PF_FBSessionDelegate> _sessionDelegate;
+ PF_FBRequest* _request;
+ PF_FBDialog* _loginDialog;
+ PF_FBDialog* _fbDialog;
+ NSString* _appId;
+ NSString* _localAppId;
+ NSArray* _permissions;
+}
+
+@property(nonatomic, copy) NSString* accessToken;
+@property(nonatomic, copy) NSDate* expirationDate;
+@property(nonatomic, assign) id<PF_FBSessionDelegate> sessionDelegate;
+@property(nonatomic, copy) NSString* localAppId;
+
+- (id)initWithAppId:(NSString *)appId
+ andDelegate:(id<PF_FBSessionDelegate>)delegate;
+
+- (void)authorize:(NSArray *)permissions;
+
+- (void)authorize:(NSArray *)permissions
+ localAppId:(NSString *)localAppId;
+
+- (BOOL)handleOpenURL:(NSURL *)url;
+
+- (void)logout:(id<PF_FBSessionDelegate>)delegate;
+
+- (PF_FBRequest*)requestWithParams:(NSMutableDictionary *)params
+ andDelegate:(id <PF_FBRequestDelegate>)delegate;
+
+- (PF_FBRequest*)requestWithMethodName:(NSString *)methodName
+ andParams:(NSMutableDictionary *)params
+ andHttpMethod:(NSString *)httpMethod
+ andDelegate:(id <PF_FBRequestDelegate>)delegate;
+
+- (PF_FBRequest*)requestWithGraphPath:(NSString *)graphPath
+ andDelegate:(id <PF_FBRequestDelegate>)delegate;
+
+- (PF_FBRequest*)requestWithGraphPath:(NSString *)graphPath
+ andParams:(NSMutableDictionary *)params
+ andDelegate:(id <PF_FBRequestDelegate>)delegate;
+
+- (PF_FBRequest*)requestWithGraphPath:(NSString *)graphPath
+ andParams:(NSMutableDictionary *)params
+ andHttpMethod:(NSString *)httpMethod
+ andDelegate:(id <PF_FBRequestDelegate>)delegate;
+
+- (void)dialog:(NSString *)action
+ andDelegate:(id<PF_FBDialogDelegate>)delegate;
+
+- (void)dialog:(NSString *)action
+ andParams:(NSMutableDictionary *)params
+ andDelegate:(id <PF_FBDialogDelegate>)delegate;
+
+- (BOOL)isSessionValid;
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Your application should implement this delegate to receive session callbacks.
+ */
+@protocol PF_FBSessionDelegate <NSObject>
+
+@optional
+
+/**
+ * Called when the user successfully logged in.
+ */
+- (void)fbDidLogin;
+
+/**
+ * Called when the user dismissed the dialog without logging in.
+ */
+- (void)fbDidNotLogin:(BOOL)cancelled;
+
+/**
+ * Called when the user logged out.
+ */
+- (void)fbDidLogout;
+
+@end
342 Parse.framework/Headers/PF_MBProgressHUD.h
@@ -0,0 +1,342 @@
+//
+// MBProgressHUD.h
+// Version 0.4
+// Created by Matej Bukovinski on 2.4.09.
+//
+
+// This code is distributed under the terms and conditions of the MIT license.
+
+// Copyright (c) 2011 Matej Bukovinski
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <UIKit/UIKit.h>
+
+@protocol MBProgressHUDDelegate;
+
+/////////////////////////////////////////////////////////////////////////////////////////////
+
+typedef enum {
+ /** Progress is shown using an UIActivityIndicatorView. This is the default. */
+ MBProgressHUDModeIndeterminate,
+ /** Progress is shown using a MBRoundProgressView. */
+ MBProgressHUDModeDeterminate,
+ /** Shows a custom view */
+ MBProgressHUDModeCustomView
+} PF_MBProgressHUDMode;
+
+typedef enum {
+ /** Opacity animation */
+ MBProgressHUDAnimationFade,
+ /** Opacity + scale animation */
+ MBProgressHUDAnimationZoom
+} PF_MBProgressHUDAnimation;
+
+/////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Displays a simple HUD window containing a progress indicator and two optional labels for short messages.
+ *
+ * This is a simple drop-in class for displaying a progress HUD view similar to Apples private UIProgressHUD class.
+ * The MBProgressHUD window spans over the entire space given to it by the initWithFrame constructor and catches all
+ * user input on this region, thereby preventing the user operations on components below the view. The HUD itself is
+ * drawn centered as a rounded semi-transparent view witch resizes depending on the user specified content.
+ *
+ * This view supports three modes of operation:
+ * - MBProgressHUDModeIndeterminate - shows a UIActivityIndicatorView
+ * - MBProgressHUDModeDeterminate - shows a custom round progress indicator (MBRoundProgressView)
+ * - MBProgressHUDModeCustomView - shows an arbitrary, user specified view (@see customView)
+ *
+ * All three modes can have optional labels assigned:
+ * - If the labelText property is set and non-empty then a label containing the provided content is placed below the
+ * indicator view.
+ * - If also the detailsLabelText property is set then another label is placed below the first label.
+ */
+@interface PF_MBProgressHUD : UIView {
+ PF_MBProgressHUDMode mode;
+
+ __unsafe_unretained id delegate;
+
+ SEL methodForExecution;
+ id targetForExecution;
+ id objectForExecution;
+ BOOL useAnimation;
+
+ UILabel *label;
+ UILabel *detailsLabel;
+
+ float progress;
+
+ NSString *labelText;
+ NSString *detailsLabelText;
+
+ BOOL isFinished;
+
+ CGAffineTransform rotationTransform;
+}
+
+/**
+ * Creates a new HUD, adds it to provided view and shows it. The counterpart to this method is hideHUDForView:animated:.
+ *
+ * @param view The view that the HUD will be added to
+ * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
+ * animations while disappearing.
+ * @return A reference to the created HUD.
+ *
+ * @see hideHUDForView:animated:
+ */
++ (PF_MBProgressHUD *)showHUDAddedTo:(UIView *)view animated:(BOOL)animated;
+
+/**
+ * Finds a HUD sibview and hides it. The counterpart to this method is showHUDAddedTo:animated:.
+ *
+ * @param view The view that is going to be searched for a HUD subview.
+ * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
+ * animations while disappearing.
+ * @return YES if a HUD was found and removed, NO otherwise.
+ *
+ * @see hideHUDForView:animated:
+ */
++ (BOOL)hideHUDForView:(UIView *)view animated:(BOOL)animated;
+
+/**
+ * A convenience constructor that initializes the HUD with the window's bounds. Calls the designated constructor with
+ * window.bounds as the parameter.
+ *
+ * @param window The window instance that will provide the bounds for the HUD. Should probably be the same instance as
+ * the HUD's superview (i.e., the window that the HUD will be added to).
+ */
+- (id)initWithWindow:(UIWindow *)window;
+
+/**
+ * A convenience constructor that initializes the HUD with the view's bounds. Calls the designated constructor with
+ * view.bounds as the parameter
+ *
+ * @param view The view instance that will provide the bounds for the HUD. Should probably be the same instance as
+ * the HUD's superview (i.e., the view that the HUD will be added to).
+ */
+- (id)initWithView:(UIView *)view;
+
+/**
+ * The UIView (i.g., a UIIMageView) to be shown when the HUD is in MBProgressHUDModeCustomView.
+ * For best results use a 37 by 37 pixel view (so the bounds match the build in indicator bounds).
+ */
+@property (retain) UIView *customView;
+
+/**
+ * MBProgressHUD operation mode. Switches between indeterminate (MBProgressHUDModeIndeterminate) and determinate
+ * progress (MBProgressHUDModeDeterminate). The default is MBProgressHUDModeIndeterminate.
+ *
+ * @see MBProgressHUDMode
+ */
+@property (assign) PF_MBProgressHUDMode mode;
+
+/**
+ * The animation type that should be used when the HUD is shown and hidden.
+ *
+ * @see MBProgressHUDAnimation
+ */
+@property (assign) PF_MBProgressHUDAnimation animationType;
+
+/**
+ * The HUD delegate object. If set the delegate will receive hudWasHidden callbacks when the HUD was hidden. The
+ * delegate should conform to the MBProgressHUDDelegate protocol and implement the hudWasHidden method. The delegate
+ * object will not be retained.
+ */
+@property (assign) id<MBProgressHUDDelegate> delegate;
+
+/**
+ * An optional short message to be displayed below the activity indicator. The HUD is automatically resized to fit
+ * the entire text. If the text is too long it will get clipped by displaying "..." at the end. If left unchanged or
+ * set to @"", then no message is displayed.
+ */
+@property (copy) NSString *labelText;
+
+/**
+ * An optional details message displayed below the labelText message. This message is displayed only if the labelText
+ * property is also set and is different from an empty string (@"").
+ */
+@property (copy) NSString *detailsLabelText;
+
+/**
+ * The opacity of the HUD window. Defaults to 0.9 (90% opacity).
+ */
+@property (assign) float opacity;
+
+/**
+ * The x-axis offset of the HUD relative to the centre of the superview.
+ */
+@property (assign) float xOffset;
+
+/**
+ * The y-ayis offset of the HUD relative to the centre of the superview.
+ */
+@property (assign) float yOffset;
+
+/**
+ * The amounth of space between the HUD edge and the HUD elements (labels, indicators or custom views).
+ *
+ * Defaults to 20.0
+ */
+@property (assign) float margin;
+
+/**
+ * Cover the HUD background view with a radial gradient.
+ */
+@property (assign) BOOL dimBackground;
+
+/*
+ * Grace period is the time (in seconds) that the invoked method may be run without
+ * showing the HUD. If the task finishes befor the grace time runs out, the HUD will
+ * not be shown at all.
+ * This may be used to prevent HUD display for very short tasks.
+ * Defaults to 0 (no grace time).
+ * Grace time functionality is only supported when the task status is known!