Core Data <--> NSArrayController sync{spam?}
Core Data <--> NSArrayController sync{spam?}
- Subject: Core Data <--> NSArrayController sync{spam?}
- From: "Frederick C. Lee" <email@hidden>
- Date: Fri, 27 Jan 2006 22:10:18 -0800
How can I sync the front-end (NSArrayController) with the
ManagedObjectContext
so that I don't get flagged with incomplete data errors upon exit?
Scenario:
1) Press 'Add' button to add an empty object instance to an entity.
2) Press 'Remove' button to remove created (empty) object
{...and restore to original status}
3) Press 'Exit' button to exit panel.
I get an ERROR dialog essentially stating that it can't save
incomplete data.
I'm using the following notification to enable/disable some buttons:
- (void)contextDidChange:(NSNotification *)notification {
if ([[[NSApp keyWindow] title] isEqualToString:@"RegionMap
Panel"]) {
if (nil != [[notification userInfo]
objectForKey:@"inserted"]) {
// New Object Added:
[gvNewRegionMapButton setEnabled:YES];
[gvRegionMapRemoveButton setEnabled:YES];
}
else {
// Current Object Removed:
[gvNewRegionMapButton setEnabled:NO];
[gvRegionMapRemoveButton setEnabled:NO];
[managedObjectContext processPendingChanges]; <-- this
doesn't appear to 'sync'.
}
}
return;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden