Skip to content

Instantly share code, notes, and snippets.

@gfosco
Last active August 29, 2015 14:02
Show Gist options
  • Save gfosco/ac6b5ebb42791ced0932 to your computer and use it in GitHub Desktop.
Save gfosco/ac6b5ebb42791ced0932 to your computer and use it in GitHub Desktop.
// Add these two method declarations to the Parse.framework/Headers/PFObject.h header file in your Xcode project:
- (void)serializeToDataFile:(NSString *)filename;
+ (id)objectFromDataFile:(NSString *)filename;
// and you can start saving and loading PFObject on disk
PFObject *object = [PFObject objectWithClassName:@"Todo"];
[object setObject:@"Sample Text" forKey:@"text"];
[object saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
[object serializeToDataFile:@"test.obj"];
}];
// Elsewhere ...
PFObject *newObj = [PFObject objectFromDataFile:@"test.obj"];
NSLog(@"%@", newObj);
@gfosco
Copy link
Author

gfosco commented Jul 6, 2015

They are just considered 'private' methods, as in Parse does not intend for external developers to use it and it's not supported, could change, etc..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment