Re: Core Data Bindings with Table View
Re: Core Data Bindings with Table View
- Subject: Re: Core Data Bindings with Table View
- From: Tim Isted <email@hidden>
- Date: Mon, 25 Aug 2008 19:25:21 +0100
You can make use here of the 'Content Set' binding on an
NSArrayController.
So, bind your Files table view column to Files.arrangedObjects.path
and then set the Content Set of the Files NSArrayController to point
to the Apps array controller selection.files.
If you have Add/Remove buttons for the Files array controller, these
will work by adding a new file into the selected App's relatedFile
relationship. You can also disable the Add button if you wish when no
App is selected by binding to the File array controller's canAdd: key.
All of this works off the Content Set binding.
Tim
On 25 Aug 2008, at 19:11, John Joyce wrote:
I'm having a little difficulty making sense of the right bindings
here.
I'm using Core Data. No problem, simple modeling.
Entity: App
Attribute: name
Relationship: relatedFile (to many)
Entity: File
Attribute: path
Relationship: relatedApp (to one)
NSArrayControllers: Apps, Files
Both are bound to the AppDelegate.managedObjectContext
and are set to their respective Entities; App and File
In my NIB/XIB, I've got two tableViews.
One lists the Apps. No problem binding its single table column to
Apps.arrangedObjects.name in the inspector.
Can add and remove fine.
The other tableView is intended to list files related (if any) to
the app selected in the Apps TableView.
The Files TableView is also a single column. I cannot figure out how
to properly bind this thing.
I'm sure I'm missing something simple and obvious here...
_______________________________________________
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
_______________________________________________
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