• 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: Programatically bind NSArrayController to NSManagedObjectContext?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programatically bind NSArrayController to NSManagedObjectContext?


  • Subject: Re: Programatically bind NSArrayController to NSManagedObjectContext?
  • From: mmalc crawford <email@hidden>
  • Date: Sun, 30 Sep 2007 17:40:56 -0700


On Sep 30, 2007, at 4:36 PM, Jerry Krinock wrote:

[arrayController setManagedObjectContext:xxx] ;
[arrayController setEntityName:yyy] ;
[arrayController prepareContent] ;
NSManagedObjectContext is not listed in the Cocoa Bindings Reference [1]. Is this really a "binding", or is it something else? The documentation for binding NSArrayController 'managedObjectContext' in [1] calls it "registered with".
It's not clear what this means.
Bindings are bindings.
Well, I would say that the code I entered above is not a binding because it does not, and could not, invoke bind:toObject:withKeyPath:options

It's again not clear what this means.
The code you wrote above is, obviously, not a binding -- you're setting the managed object context directly using an accessor method.
You can, however, bind the 'managedObjectContext' binding of controllers -- it is common(*), for example, in a document-based application to bind it to [TheDocument].managedObjectContext.


If you wanted to do this in, say, the implementation of windowControllerDidLoadNib in a subclass of NSPersistentDocument it would look like:

[arrayController bind:@"managedObjectContext"
            toObject:self
         withKeyPath:@"managedObjectContext"
             options:nil] ;


(*) Largely because it's easy to do and code-free..

mmalc

_______________________________________________

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


References: 
 >Programatically bind NSArrayController to NSManagedObjectContext? (From: Jerry Krinock <email@hidden>)
 >Re: Programatically bind NSArrayController to NSManagedObjectContext? (From: mmalc crawford <email@hidden>)
 >Re: Programatically bind NSArrayController to NSManagedObjectContext? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: How can we draw a NSWindow in a custom NSView?
  • Next by Date: Re: What cause EXC_BAD_ACCESS?
  • Previous by thread: Re: Programatically bind NSArrayController to NSManagedObjectContext?
  • Next by thread: Snippets repository
  • Index(es):
    • Date
    • Thread