Created
June 2, 2015 21:41
-
-
Save vikdenic/58646a5d2c95e021dced to your computer and use it in GitHub Desktop.
init managedobject
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
| -(instancetype)initWithName:(NSString *)name andGeoPoint:(PFGeoPoint *)geoPoint { | |
| AppDelegate *appDelegate = [[UIApplication sharedApplication]delegate]; | |
| self = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([CDRegion class]) inManagedObjectContext:appDelegate.managedObjectContext]; | |
| self.name = name; | |
| self.longitude = [NSNumber numberWithDouble:geoPoint.longitude]; | |
| self.latitude = [NSNumber numberWithDouble: geoPoint.latitude]; | |
| return self; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment