Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danielctull/616011 to your computer and use it in GitHub Desktop.
Save danielctull/616011 to your computer and use it in GitHub Desktop.
@implementation DCTCDGroup (DCTManagedObjectAutomatedSetup)
+ (NSDictionary *)dct_mappingFromRemoteNamesToLocalNames {
NSMutableDictionary *d = [[NSMutableDictionary alloc] init];
[d setObject:@"groupID" forKey:@"id"];
[d setObject:@"groupDescription" forKey:@"description"];
return [d autorelease];
}
+ (id)dct_convertValue:(id)value toCorrectTypeForKey:(NSString *)key {
if ([key isEqualToString:@"date"])
return [NSDate dateWithTimeIntervalSince1970:[value doubleValue]];
return nil;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment