I am using a notification with the name NSManagedObjectContextDidSaveNotification and when it receives the notification, the userInfo dictionary contains all the changes just made to the context during the save. How can I extrapolate that data into my managed object model? I tried doing this
- (void)addControllerContextDidSave:(NSNotification*)saveNotification {
NSMutableDictionary *userInfo = (NSMutableDictionary *)[saveNotification userInfo];
NSLog(@"userInfo is %@", userInfo);
TaskInfo *taskInfo = (TaskInfo *)[userInfo objectForKey:@"inserted"];
NSLog(@"taskInfo is %@", taskInfo);
}
Where TaskInfo is my custom managed object model. And that printed this
userInfo is {
inserted = "{(\n <TaskInfo: 0x15f350> (entity: TaskInfo; id: 0x13fda0 <x- coredata://1F98E14E-259F-4CB3-84E2-9AC8466CCD1B/TaskInfo/p2> ; data: {\n completionDate = nil;\n creationDate = \"2011-12-08 02:14:04 +0000\";\n duration = 10860;\n elapsedTime = 0;\n isCompleted = 0;\n isRepeating = 0;\n isRunning = 0;\n isToday = 0;\n projectedEndTime = nil;\n specifics = nil;\n startTime = nil;\n timesReminded = 0;\n title = haha;\n})\n)}";
updated = "{(\n)}";
}
2011-12-07 20:14:54.147 Tisk Task 3[3161:707] taskInfo is {(
<TaskInfo: 0x15f350> (entity: TaskInfo; id: 0x13fda0 <x-coredata://1F98E14E-259F- 4CB3-84E2-9AC8466CCD1B/TaskInfo/p2> ; data: {
completionDate = nil;
creationDate = "2011-12-08 02:14:04 +0000";
duration = 10860;
elapsedTime = 0;
isCompleted = 0;
isRepeating = 0;
isRunning = 0;
isToday = 0;
projectedEndTime = nil;
specifics = nil;
startTime = nil;
timesReminded = 0;
title = haha;
})
)}
I think the issue is the extra set of {()} on the outside of the TaskInfo model. Anyone have any suggestions?