Re: "to-many" bindings in Interface Builder
Re: "to-many" bindings in Interface Builder
- Subject: Re: "to-many" bindings in Interface Builder
- From: John <email@hidden>
- Date: Sat, 17 Apr 2004 18:00:42 +0100
Hi,
Yes that would be the idea of my program, and that solution works
perfectly.
Thanks.
John.
On 17 Apr 2004, at 17:08, Allan Odgaard wrote:
On 17. Apr 2004, at 10:48, John wrote:
I have a table of customers, each customer can have many invoices,
and each invoice can have many invoiceLineItems.
Is the goal to have 3 table views where the first show all customers,
the second show the invoices of the current customer and the third
show the lines of that invoice (i.e. just like an NSBrowser)?
In that case you need 3 array controllers and you need to bind the
'contentArray' of the third one (showing the invoice lines) to the
second one (showing the invoices) with a key path like
'selection.invoiceLines' -- where 'invoiceLines' is the key of the
invoice record/dictionary holding an invoice line array -- so each
time the selection is changed in the second array controller, the
entire content is changed in the third one.
Likewise bind 'contentArray' of the second array controller to
'selection.invoices' of the first array controller -- here 'invoices'
is the key in the customer record/dictionary holding the invoice
array.
The first array controllers 'contentArray' is bound (or connected) to
where ever you store the array of all customers.
Finally bind the various table column values to the proper array
controllers.
Hope it helps...
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.