views:

151

answers:

0

Hi all,

I have a problem with two contexts. There is the default manged object context and an import context wich is used for imports. When the import context saves its date a notification is send to merge the changes with the default context: here is the code

- (void)updateCompleted {
[[NSNotificationCenter defaultCenter] addObserver:self 
                                         selector:@selector(importContextDidSave:) 
                                             name:NSManagedObjectContextDidSaveNotification
                                           object:importContext];
[importContext save:nil];
[importContext release];
}

- (void)importContextDidSave:(NSNotification *)saveNotification {
    [managedObjectContext mergeChangesFromContextDidSaveNotification:saveNotification];
}

The - (void)importContextDidSave:(NSNotification )saveNotification is called after the initial import. Any upcoming updates send name:NSManagedObjectContext*Will*SaveNotification but no NSManagedObjectContext*Did**SaveNotification.

Any ideas why? Answers are much appreciated.