• 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: window controllers and managed object contexts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: window controllers and managed object contexts


  • Subject: Re: window controllers and managed object contexts
  • From: Daniel Child <email@hidden>
  • Date: Sat, 27 Sep 2008 13:01:47 -0400

Hmm, well that seems to be the catch. I can't get the bindings to work for the MOC.
First off, to set up the table displayed in the window loaded with a separate nib file, I simply dragged in an "entity" object from the Librarian. That doesn't set up an MOC binding, but, following an on- line tutorial, I told it to bind the MOC parameter to File'sOwner, and immediately the setting is managedObjectContext. (Looked promising.)


Now, when I init the window, I do pass in a copy of the App's own MOC (I don't have multiple MOCs). But now I get the message:

not key-value coding-compliant for the value: managedObjectContext.

Which makes me wonder, just how much code needs to go into setting up a separate window controller, and is it worth it (speed-wise) if your app only has four or five windows. From a tidiness standpoint, it's nice of course to separate the control portion of MVC for each window, but is all that copying and key-value coding going to be faster than simply loading one big nib?

And, given that Xcode is supposed to automatically set up bindings correctly for things like Entity, why does it not work in this case? The error message seems to suggest I need to be doing something like:

[myWindow setObject: theMOC forKey: @"managedObjectContext"

but the tutorial online uses plain accessors (with the local copy of MOC as an ivar, not a property) ... and works. One difference is that their's is a doc-based CoreData app, and mine is not. But I don't see why that should matter....

So I'm forced to use a property to express MOC in the window controller???


On Sep 26, 2008, at 3:29 PM, Kyle Sluder wrote:

Erm, NSWindowController shouldn't be asking for a MOC.  Perhaps
whatever NSControllers you have in your nibs haven't had their
managedObjectContext bindings fixed?

_______________________________________________

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: window controllers and managed object contexts
      • From: mmalc crawford <email@hidden>
References: 
 >window controllers and managed object contexts (From: Daniel Child <email@hidden>)
 >Re: window controllers and managed object contexts (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Accepting file promise drags
  • Next by Date: Re: showing window causes EXC_BAD_ACCESS
  • Previous by thread: Re: window controllers and managed object contexts
  • Next by thread: Re: window controllers and managed object contexts
  • Index(es):
    • Date
    • Thread