Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data Bindings with Table View



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Core Data Bindings with Table View (From: John Joyce <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.