I have a Core Data application with two entities: Item and Entries. Item has a 
dataType string variable. Item has a to-many inverse relationship to Entries. 
Entries has two variables: stringData and numberData.

I'm programmatically creating an NSTableColumn for each Item. The cell type of 
the column is defined by the Item's dataType variable. This part is working.

The goal is for each Item to have a column, and when clicking an Add New Entry 
button, a new Entry is created for each Item. The interface would add one row, 
with the value bound to the corresponding stringData or numberData for the 
Entry for that Item.

Right now, the Add New Entry button/method loops through the Items and creates 
a new Entry for each... that's working okay. Where I'm having problems is 
figuring out the bindings to properly display the columns. The bind statement 
I'm using is:

[itemColumn bind:@"value" toObject:entryArrayController 
withKeyPath:@"arrangedObjects.numberData" options:nil];

(It's in an if statement, so it binds to either numberData or stringData as 
appropriate.)

This results in 1 row being added for each Item, and the entire row is bound to 
the same value. So if I have 6 Items, I correctly have 6 columns (one for each 
Item) but clicking Add New Entry it incorrectly generates 6 rows, one for each 
Item.

I've tried many variations of the toObject and withKeyPath: values to no avail. 
I've looked through all the Key Value Coding and other Apple dev documentation 
and Googled like mad, but after 3 unproductive days I'm hoping someone here can 
help.

---
Michael A. LaMorte
Minder Softworks
a division of Springboard Enterprises Ltd

_______________________________________________

Cocoa-dev mailing list ([email protected])

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/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to