Re: Even More Bindings!
Re: Even More Bindings!
- Subject: Re: Even More Bindings!
- From: J Nozzi <email@hidden>
- Date: Fri, 16 Jul 2004 19:55:14 -0400
Any asset can be in any container (though only once per container).
I'm not sure how this advice applies. ;-) It very probably does, I just
don't see it. Any more suggestions?
- J
On Jul 16, 2004, at 7:42 PM, Mont Rothstein wrote:
This is just a guess because I haven't worked with them yet, but what
about
a value transformer?
http://developer.apple.com/documentation/Cocoa/Conceptual/
ValueTransformers/
index.html#//apple_ref/doc/uid/10000175i
What you ideally want to do is store the Primary Key (assetID) for your
asset in an array owned by the container, or store the container's
Primary
Key in the asset it self, if the asset will only be in one container.
In the first scenario (assets can be on more than one container) you
have a
many-to-many relationship and need a go-between model. In the second
scenario you can use a simple to-many relationship.
So, if the value transformer doesn't work, and assuming you have a
many-to-many relationship, try putting a array controller between the
two
and punching through from the container through the go-between to the
asset
via a key value path.
-Mont
On 7/16/04 3:58 PM, "J Nozzi" <email@hidden> wrote:
List:
I have an array controller called "assetsArrayController" that
contains 'asset' objects. I have a second array controller called
"containerArrayController" that contains 'asset container' objects.
Assets have a key called 'assetID' and another called 'assetType'
which
determines the icon it uses, and 'assetTitle'.
I want to be able to drag 'assets' into 'containers' and add them
(drag-n-drop is working fine, that's not the issue). Obviously, for
efficiency's sake, I want only to add the 'assetID' to the container
array.
SO ... when you view the contents of each container, you see a list
of assets with the appropriate image and title. When you edit the
asset's title in the asset list, the container is automatically
updated.
What I'm struggling with is the fundamental question of how to use
the assetID in the container array controller to fetch the title of
the
'asset' object in my assets array controller by its assetID ... In
other words, how can I bind the 'title' column in the container array
to data in the asset array by its unique ID?
Is this clear? Do I need to be more specific anywhere?
Regards,
- J
_______________________________________________
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.
_______________________________________________
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.