• 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
Core Data / Bindings problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data / Bindings problem


  • Subject: Core Data / Bindings problem
  • From: Alain Schartz <email@hidden>
  • Date: Wed, 29 Aug 2007 08:49:59 -0700

Hello List,

I'm having problems with Bindings in a Core Data environment. This is what I'm dealing with:

I have an NSOutlineView bound to an NSTreeController which is configured to display "TreeNode" entities (class: NSManagedObject). The "TreeNode" entity has a "name" attribute, which the NSOutlineView binds against. I included "parent" and "children" attributes In all the other entities I want to display in the tree view and I add them programatically to the tree. Again, every entity has a "name" attribute. So in the end my tree looks like this:

Database (<- "TreeNode" entity, NSManagedObject class)
 - Tables (<- "TreeNode" entity)
    - Table1 (<- "Table" entity, "MyTable" class)
    - Table2 (<- "Table" entity)
 - Views (<- "TreeNode" entity)
    - View1 (<- "View" entity, "MyView" class)
    - ...

You get the picture. So far, everything works fine.

Now I want to display a "details" pane which displays all the data of the object the user clicked on (i.e. the user clicks on Table1, the details pane should display table1.name, table1.comments etc.) And this is NOT working as expected.

I declared several NSTextFields bound to an NSObjectController (pointing to the "Table" entity). For this to work I thought to point the NSObjectController's contentObject to treeController.selection... but this is not working.

I suppose the main problem resides in the fact that the entities used by the treeController ("TreeNodes") are different from the entities I want to display in my details panel ("Table"); every bindings combination I tried either resulted in "selector not recognized" or KVO error messages (or simply nothing happening at all). So my question is, how do I tell my NSObjectController to take the selection.name from NSTreeController (and thus "casting" the "TreeNode" entity to the details-pane "Table" entity) ?

Since both have a "name" attribute methinks this should somehow be feasable? Any pointer in the right direction would be greatly appreciated!

Thanks a lot,
Alain
_______________________________________________

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 / Bindings problem
      • From: mmalc crawford <email@hidden>
  • Prev by Date: [Q] Remote Messaging : Keep sending msg to a destroyed remote object
  • Next by Date: Line Numbers in Tables
  • Previous by thread: Re: [Q] Remote Messaging : Keep sending msg to a destroyed remote object
  • Next by thread: Re: Core Data / Bindings problem
  • Index(es):
    • Date
    • Thread