Skip to content

ankor/OEGParseBackedModel

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

OEGParseBackedModel

Simple superclass for models persisted to Parse.com.

To get a nice model class instead of dealing with generic PFObjects all the time, define your model like this:

@interface Model : OEGParseBackedModel
@property (nonatomic) NSString *name;
@end

@implementation Model
@dynamic name;

- (id)init {
  return [super initWithClassName:@"Model"];
}

@end

Then use it like this:

Model *model = [[Model alloc] init];
model.name = @"Maverick";
[model saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
  if (succeeded) {
    NSLog(@"Model saved to Parse!");
  }
}];

The code is very basic but perhaps it can serve as some kind of inspiration to someone. It should check if the property is declared as readonly and not generate a setter in that case.

About

Simple superclass for models persisted to Parse.com.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published