Re: Core data question in multiwindow doc app
Re: Core data question in multiwindow doc app
- Subject: Re: Core data question in multiwindow doc app
- From: Steven Hamilton <email@hidden>
- Date: Sat, 28 Jun 2008 12:25:41 +1000
On 28/06/2008, at 4:32 AM, Ben Trumbull wrote:
When I add a new account entity my outlineview doesn't know. Should I
be using a notification to find out when a new account entity is
added. If so, which one?
The easiest way to track insertions and deletions in the
NSManagedObjectContext is the notification
NSManagedObjectContextObjectsDidChangeNotification.
Yep, seems easy enough but I can't get it to send a notification. I
add an Account entity and the notification isn't sent. However, if I
save and reload the file, or close and reopen the window with the
outlineview my tree is rebuilt and I see the new account. I'm sure its
to do with the way I'm referencing the manageObjectContext. I'm not
very happy about this [self.document ] path I keep using. Is this the
correct way to source the MOC in a document app?
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(buildSourceList)
name:@"NSManagedObjectContextObjectsDidChangeNotification" object:
[self.document managedObjectContext]];
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden