Created
June 26, 2012 19:57
-
-
Save EchoAbstract/2998484 to your computer and use it in GitHub Desktop.
Managed Object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @implementation managedObject | |
| @synthesize managedObjectContext; | |
| + (NSDictionary *)kinveyObjectBuilderOptions | |
| { | |
| static NSDictionary *options = nil; | |
| if (options == nil){ | |
| options = [NSDictionary dictionaryWithObjectsAndKeys: | |
| [NSNumber numberWithBool:YES], KCS_USE_DESIGNATED_INITIALIZER_MAPPING_KEY,nil]; | |
| } | |
| return options; | |
| } | |
| + (id)kinveyDesignatedInitializer | |
| { | |
| NSManagedObjectContext *moc = [[AppDelegate sharedAppController] managedObjectContext]; | |
| NSEntityDescription *newsEntity = [NSEntityDescription entityForName:@"managedObject" inManagedObjectContext:moc]; | |
| NSManagedObject *object = [[NSManagedObject alloc] initWithEntity:myEntity insertIntoManagedObjectContext:moc]; | |
| // We're using ARC, so we don't need to autorelease the object, arc *should* take care of that for us | |
| return object; | |
| } | |
| - (NSDictionary *)hostToKinveyPropertyMapping | |
| { | |
| return [NSDictionary dictionaryWithObjectsAndKeys: | |
| @"title", @"title", | |
| @"eventDescription", @"eventDescription", | |
| @"subtitle", @"subtitle", | |
| @"_id", @"kinveyID", nil]; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment