Simple superclass for models persisted to
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Simple superclass for models persisted to

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;

@implementation Model
@dynamic name;

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


Then use it like this:

Model *model = [[Model alloc] init]; = @"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.