Slide 3
Slide 3 text
- (void)updateWithDictionary:(NSDictionary *)dictionary
context:(NSManagedObjectContext *)context {
[self.remoteToLocalAttributeMap
each:^(NSString *remoteName, NSString *localName) {
id remoteValue = dictionary[remoteName];
if ([(NSNull *)remoteValue isEqual:[NSNull null]]) return;
if (self.remoteDateFormats[remoteName]) {
remoteValue = [NSDate dateFromString:remoteValue
format:self.remoteDateFormats[remoteName]];
}
[self setValue:remoteValue forKeyPath:localName];
}];
}
(Yes, this is fun)