Created
March 13, 2011 02:49
-
-
Save whalec/867827 to your computer and use it in GitHub Desktop.
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 InspectionFollowupDateToPropertyMigration | |
- (BOOL)createRelationshipsForDestinationInstance:(NSManagedObject *)source entityMapping:(NSEntityMapping *)mapping | |
manager:(NSMigrationManager *)manager error:(NSError **)error | |
{ | |
NSMutableSet *inspections = [source valueForKey:@"inspections"]; | |
for (id inspection in inspections) | |
{ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSDate *inspectionDate = [inspection valueForKey:@"followupNextDueDate"]; | |
if (inspectionDate != nil) | |
{ | |
[source setValue:inspectionDate forKey:@"followUpNextDueDate"]; | |
} | |
[pool drain]; | |
} | |
return [super createRelationshipsForDestinationInstance:source entityMapping:mapping manager:manager error:error];; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment