• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core data question in multiwindow doc app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Core data question in multiwindow doc app
      • From: Chris Hanson <email@hidden>
References: 
 >re: Core data question in multiwindow doc app (From: Ben Trumbull <email@hidden>)

  • Prev by Date: Re: Opening a Panel
  • Next by Date: Re: Opening a Panel
  • Previous by thread: re: Core data question in multiwindow doc app
  • Next by thread: Re: Core data question in multiwindow doc app
  • Index(es):
    • Date
    • Thread