Skip to content

Instantly share code, notes, and snippets.

@gfosco
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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);
@thibautrey
Copy link

I'm not sure I understand the damn thing. Is it because they did implement the method serializeToDataFile and objectFromDataFile but didn't declare them in the header because they thought it wasn't ready ? Could you provide a bit more detail about this please ?

@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