Re: Two TreeControllers, one ArrayController and the ContentSet binding...
Re: Two TreeControllers, one ArrayController and the ContentSet binding...
- Subject: Re: Two TreeControllers, one ArrayController and the ContentSet binding...
- From: Kam Dahin <email@hidden>
- Date: Mon, 16 Oct 2006 17:47:06 -0700
Thanks for the reply Scott --
Here is a more detailed breakdown of what I am doing.
The Node entities have a to-many relationship called "mediaFiles" -
which map to my MediaFile entity.
I use two different types of Nodes (subclasses of the Node entity)
"Source" and "Target". The "Source" type is a read-only
representation of a folder structure that contains different types of
media files. These media files show up in the TableView where the
user can tag them with meta data.
The target type of Node stores the media files that the user has
tagged. The user can create various numbers of these nodes and each
of these nodes can contain mediaFile entities. Basically this type
of Node creates a new structure of folders with the newly tagged
media files organized into the locations that the user has created.
MediaFile entities are displayed in the TableView hold information
about a particular "real" file.
So the flow of the app is like this:
User selects the location of the media files he/she wants to tag.
User tags these files with the approperiate meta data in the Table view.
User adds these media files to the target nodes and sub nodes.
User can select the target nodes to see the files they have tagged
and continue to edit them.
or the user can select the various source nodes and edit any
associated files there.
I want the user to be able to click on the target nodes and see the
files they have added to the selected node in the TableView. This
way, they can change any of the metadata they need to. They also can
always go back up to the source tree and view the media files there,
so they need to be able to select the source nodes and see the
original files there.
To your last question:
I was wondering if could create a fetch request that would get all of
the MediaFile entities for the selected node and then set the content
of the ArrayController with that information? Basically I am trying
to do this with the tools that CoreData provides instead of having to
resort to a more manual approach (the NSMutableSet idea from the
first email) --
Hopefully this makes more sense.
Thanks again for your quick response -- I read your blog all the time
and Cocoa Dev Central has been a huge part of my Cocoa learning
experience... So thank you for that also.
Regards,
K
On Oct 16, 2006, at 5:10 PM, Scott Stevenson wrote:
On Oct 16, 2006, at 4:34 PM, Kam Dahin wrote:
> What I am trying to do is have the content of the ArrayController
> change based on the selected node in the TreeControllers. This
> isn't a problem with one TreeController, but since I have two, I am
> running into trouble and I was hoping someone could help me out.
>
> My initial idea was to use an NSMutableSet in my main controller
> class and then have the selection of the node load the data I need
> into the MutableSet.
That might work. Another option is to have two table views and two
array controllers, and only one table view is visible to the user at
any one time.
Without knowing the whole app design, it's hard to say which approach
is cleaner.
> Since I am using CoreData, I figure there must be a way to ask the
> ManagedObjectContext for the information I need when the selection
> changes
What information do you want to ask for?
- Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden